host 文件的用途和用法 一. Hosts 文件的位置 很多用户都知道在Window 系统中有个Hosts 文件(没有后缀名),在Windows 98系统下该文件在Windows 文件夹
在Windows 2000/XP 系统中位于\%Systemroot%\System32\Drivers\Etc 文件夹中,其中,%Systemroot%指系统安装路径
例如,Windows XP 安装在C:\WINDOWS,那么Hosts 文件就在C:\Widows\System32\Drvers\Etc 中
你也可以用windows 自带的查找功能搜索找到hosts 文件
该文件其实是一个纯文本的文件,用普通的文本编辑软件如记事本等都能打开和编辑
二. Hosts 文件的基本内容和语法 用记事本打开hosts 文件,就可以看见了微软对这个文件的说明
Hosts 文件文一般有如下面的基本内容 # Copyright (c) 1993-1999 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 # sp