如何在 Windows 10 中将 Hosts 文件重置回默认值

Jacki

每个 Windows 版本都附带一个 Hosts 文件,它提供了一种将网站重定向到 IP 地址的简单机制。如果 HOSTS 文件被错误或恶意修改,则可能会破坏您的互联网。在本教程中,我们将向您展示如何轻松地将 HOSTS 文件 (C:\Windows\System32\drivers\etc\hosts) 重置回 Windows 10 中的默认值。

如何在 Windows 10 中将 Hosts 文件重置回默认值?

默认情况下,HOSTS 文件受操作系统保护,因此如果没有管理员权限,您将无法编辑它。这里我们用记事本打开HOSTS文件,并将其内容恢复为默认值:

单击开始按钮和类型记事本。右键单击搜索结果中出现的记事本应用程序,然后选择“以管理员身份运行”。

在管理员模式下打开记事本后,您就可以打开 HOSTS 文件了。单击文件菜单并选择打开

浏览到目录 C:\Windows\System32\drivers\etc\hosts。将文件过滤器下拉框从“文本文档 (*.txt)”更改为“所有文件“,然后选择 HOSTS 文件并单击打开

了解更多:如何在 Windows 11 中重置或更改文件类型的默认应用程序

现在,将以下文本粘贴到记事本中:

# 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中的HOSTS文件重置回默认值。对于Windows 8/7/Vista,HOSTS文件的内容有所不同,您可以从以下位置复制它们微软的网站