hosts找不到只有两种可能:
1.被隐藏了;
2.不存在。
如果是第一种的话,打开C:\Windows\System32\drivers\etc,点击查看
如果是第二种的话:
在此目录下:C:\Windows\System32\drivers\etc 新建一个hosts.txt文件,然后将一下内容粘贴进去。
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
修改文件hosts.txt 为: hosts 即可。
也可以Windows + R, 输入cmd,出现命令行窗口输入(复制)以下内容:
for /f %P in ('dir %windir%\WinSxS\hosts /b /s') do copy %P %windir%\System32\drivers\etc & echo %P & Notepad %P
敲进去,或者复制粘贴啦,按下Enter键就出现了hosts文件。