admin管理员组文章数量:1530842
Windows XP/2000/Vista/7/8/8.1/10系统的hosts文件的存储位置为C:\Windows\System32\drivers\etc下的hosts文件
用记事本可以直接打开编辑,或者用其他文本编辑器,比如EditPlus
hosts文件打开后的内容如下
# 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 # source server
# 38.25.63.10 x.acme # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
hosts文件保存的是IP和域名的键值对,每一个键值对必须独立一行,每一行的第一个值为IP,第二个值为对应的域名,IP和域名之间必须至少有一个空格分隔
hosts文件中可以有注释,注释可以独立一行或者跟在IP域名键值对的后面,注释以#符号开头
如下所示,我们可以添加一些IP域名键值对
# For example:
102.54.94.97 rhino.acme # source server
38.25.63.10 x.acme # x client host
hosts文件有一个作用就是把域名重定向到错误的IP地址上,这样就无法正常防伪该域名,比如如下实例我们把account.jetbrains名重定向到0.0.0.0,这样本机就无法访问account.jetbrains。有些流氓程序经常会在后台偷偷访问一些地址上传或者下载一些东西,如果知道其域名就可以重定向到错误的IP,这样这些流氓软件就无法正常访问
0.0.0.0 account.jetbrains
版权声明:本文标题:Windows XP2000Vista788.110系统 hosts文件位置及使用 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dongtai/1726109061a1055750.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论