每个Windows版本都有一个主机文件,该文件提供了一种简单的机制,可以将网站重定向到IP地址。如果主机文件被错误或恶意修改,则可能会破坏您的互联网。在本教程中,我们将向您展示如何轻松地将主机文件(C:\ Windows \ System32 \ drivers \ etc \ hosts)重置为Windows 10中的默认值。
如何将host的文件重置为Windows 10中的默认值?
默认情况下,主机文件受操作系统保护,因此您无需管理员就无法对其进行编辑。在这里,我们将使用记事本打开主机文件,并将其内容还原回默认值:
单击开始按钮和类型记事本。右键单击“记事本应用”出现在搜索结果中,然后选择“作为管理员运行“。
在管理员模式下进行记事本,您可以打开主机文件。单击文件菜单和选择打开。
浏览到目录C:\ Windows \ System32 \ drivers \ etc \ hosts。将文件过滤器下拉框从“文本文档(*.txt)”更改为“所有文件”,选择主机文件,然后单击打开。
现在,将以下文本粘贴到记事本:
# 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
# localhost name resolution is handle within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
单击文件菜单和节省。现在,您已成功将主机文件重置回Windows 10中的默认值。对于Windows 8/7/Vista,主机文件的内容是不同的,您可以从微软的网站。