用记事本打开hosts文件,首先看见了微软对这个文件的说明。这个文件是根据TCP/IP for Windows 的标准来工作的,它的作用是包含IP地址和Host name?主机名 的映射关系,是一个映射IP地址和Host name?主机名 的规定,规定要求每段只能包括一个映射关系,IP地址要放在每段的最前面,空格后再写上映射的Host name?主机名 。对于这段的映射说明用“#”分割后用文字说明。
# Copyright (c) 1993-2006 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