How to Restore Windows HOSTS File Back to Default

The HOSTS file in Microsoft Windows, maps the host names to the IP addresses. The HOSTS file overrides IP address determined through domain server lookups. This is why some malware use the HOSTS file to direct the domain names to their own malicious IP addresses. If some malware has hijacked your HOSTS file, then you can always restore the Windows HOSTS file back to its default setting. Here is how :

Method 1

  1. Press the key combination Windows logo key + R to open the Run dialog. In the Run dialog, type %systemroot%\system32\drivers\etc and press Enter. In case of 64-bit Windows XP the folder would be %systemroot%\SysWOW64\drivers\etc.

    Restore HOSTS file in Windows

  2. In the folder that opens, you would find the HOSTS file. Rename it to HOSTS.bak.

    Extract default Windows HOSTS files

  3. Download the HOSTS files ZIP archive to your desktop. It contains the default HOSTS files for Windows XP, Vista and 7. Extract the correct HOSTS file to the same folder where HOSTS.bak resides.
  4. That’s it. You have successfully restored the HOSTS file in Windows.

 

Method 2

  1. Visit the Microsoft Fixit webpage at http://support.microsoft.com/kb/972034.
  2. Click on the Fix It button to download the Microsoft Fix It tool.

    Restore HOSTS FixIt Tool

  3. Check the Agree checkbox to agree with the Microsoft license terms and then click Next.

    Running Restore HOSTS FixIt Tool

  4. After the Fix It tool has applied the changes to your system click the Close button to close the wizard.
  5. It will ask you to restart the Windows for the changes to have effect. Click on the Yes button to restart Windows.

    Restart Windows to restore HOSTS