How can I reset the Hosts file back to the default?

Article ID: 972034 - View products that this article applies to.
If you are a Small Business customer, find additional troubleshooting and learning resources at the Support for Small Business site.
Expand all | Collapse all

Problem description

This article helps you reset the Hosts file back to the default.

To have us reset the Hosts file back to the default for you, go to the "Fix it for me" section. To reset the Hosts file back to the default yourself, go to the "Let me fix it myself" section.

Fix it for me

To reset the Hosts file back to the default automatically, click the Fix it button or link, click Run in the File Download dialog box, and then follow the steps in the Fix it wizard.


Fix this problem
Microsoft Fix it 50267


Collapse this imageExpand this image
Note this wizard may be in English only. However, the automatic fix also works for other language versions of Windows.

Collapse this imageExpand this image
Note If you are not on the computer that has the problem, you can save the automatic fix to a flash drive or to a CD and then run the automatic fix on the computer that has the problem.

Next, go to the "Did this fix the problem?" section.

Let me fix it myself

To reset the Hosts file back to the default, follow these steps:
  1. Click Start, click Run, type %systemroot% \system32\drivers\etc, and then click OK.
  2. Rename the Hosts file to Hosts.old.
  3. Create a new default hosts file. To do this, follow these steps:
    1. Right-click an open space in the %WinDir%\System32\Drivers\Etc folder, point to New, click Text Document, type hosts, and then press Enter.
    2. Click Yes to confirm that the file name extension will not be .txt.
    3. Open the new Hosts file in a text editor. For example, open the file in Notepad.
    4. Copy the following text to the file:

      For Windows XP or for Windows Server 2003
      # 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
      For Windows Vista or for Windows Server 2008
      # 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
      
      127.0.0.1       localhost
      ::1             localhost
      For Windows 7
      # 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
    5. Save and then close the file.

Did this fix the problem?

Check whether the problem is fixed. If the problem is fixed, you are finished with this article. If the problem is not fixed, you can contact support.

Properties

Article ID: 972034 - Last Review: April 30, 2013 - Revision: 8.0
Applies to
  • Windows 7 Enterprise
  • Windows 7 Home Basic
  • Windows 7 Home Premium
  • Windows 7 Professional
  • Windows 7 Starter
  • Windows 7 Ultimate
  • Windows Vista Enterprise 64-bit Edition
  • Windows Vista Home Basic 64-bit Edition
  • Windows Vista Home Premium 64-bit Edition
  • Windows Vista Ultimate 64-bit Edition
  • Windows Vista Business
  • Windows Vista Business 64-bit Edition
  • Windows Vista Enterprise
  • Windows Vista Home Basic
  • Windows Vista Home Premium
  • Windows Vista Starter
  • Windows Vista Ultimate
  • Microsoft Windows XP Home Edition
  • Microsoft Windows XP Professional
  • Microsoft Windows Server 2003, Web Edition
  • Microsoft Windows Server 2003, Enterprise x64 Edition
  • Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
  • Microsoft Windows Server 2003, Standard x64 Edition
  • Microsoft Windows Server 2003, Standard Edition (32-bit x86)
  • Windows Server 2008 Datacenter
  • Windows Server 2008 Enterprise
  • Windows Server 2008 Standard
Keywords: 
kbexpertisebeginner kbsurveynew kbmsifixme kbfixme KB972034

Give Feedback