---
title: "快速修改Windows系统下hosts文件"
author: "casec12"
date: "2015-08-18T23:37:55Z"
tags: []
categories: ["操作系统"]
slug: "windows-hosts"
draft: false
lastmod: "2015-08-18T23:37:55Z"
id: 2236403
url: "https://casec12.iteye.com/blog/2236403"
---

windows下hosts文件的修改会遇到两个问题：

1. 找不到hosts文件
2. hosts文件修改不掉

可通过如下办法找到hosts文件：

dir /b/s %windir% | findstr etc\\hosts

 

可通过如下办法修改并保存hosts文件

1. 以管理员权限打开cmd
2. echo 192.168.1.101 hosts &gt;&gt; %windir%\\...\\host