如何将 hosts 文件重置为默认值?

如何将 hosts 文件重置为默认值?

如何将我的主机文件重置为默认值?

Windows 7 旗舰版 32 位

C:\WINDOWS\system32\drivers\etc

答案1

hostsWindows 7 的默认文件配置来自Microsoft 支持:如何将 Hosts 文件重置为默认值?

# 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

答案2

微软已经创建了一个自动修复此特定问题。如果您想尝试手动修复,请按照以下步骤操作:

  • 在运行窗口中输入以下内容(单击开始 > 运行):

    %systemroot%\system32\drivers\etc 
    

    (其中系统根目录通常是您的默认主根文件夹C:)。

  • 将文件名称更改hostshosts.old

  • 打开 Windows 资源管理器并转到%WinDir%\System32\Drivers\Etc文件夹(WinDir是您的 Windows 目录)
  • 创建一个新的文本文档,命名它hosts,确保文件扩展名不是文本(.txt
  • hosts使用记事本或任何其他文本编辑器打开新文件。
  • 由于您使用的是 XP,因此 hosts 文件的内容应如下:

    在此处输入图片描述

相关内容