etc文件夹里有3个hosts文件

一个hosts;一个hosts.dz;还有个hosts.ics
2025-03-24 08:13:03
推荐回答(2个)
回答1:

很多用户都知道在Window系统中有个Hosts文件(没有后缀名),在Windows 98系统下该文件在Windows文件夹。
在Windows 2000/XP系统中位于\%Systemroot%\System32\Drivers\Etc 文件夹中,其中,%Systemroot%指系统安装路径。例如,Windows XP 安装在C:\WINDOWS,那么Hosts文件就在C:\WINDOWS\system32\drivers\etc中。
你也可以用windows自带的查找功能搜索找到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
# 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

127.0.0.1 localhost

这个文件是根据TCP/IP for Windows 的标准来工作的。它的作用是定义IP地址和
Host name(主机名)的映射关系,是一个映射IP地址和Host name (主机名) 的规定。这个规定中,要求每段只能包括一个映射关系,也就是一个IP地址和一个与之有映射关系的主机名。 IP地址要放在每段的最前面,映射的Host name(主机名)在IP后面,中间用空格分隔。对于这段的映射说明,用“#”分割后用文字说明。

希望能帮到您。望采纳!

回答2:

删除后两个,
编辑前一个为:
内容为
# 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
# 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
127.0.0.1 localhost