How to reset Hosts file back to default in Windows 8 | 7

The Hosts file in Windows, is used to map host names to IP addresses. If for some reason, you find that your Hosts file has been compromised, and that some malicious entries have been added, you can if you wish, reset Hosts file back to default.

Reset Hosts file in Windows 8 | 7

The Hosts file in Windows 8 | 7 is locate at the following location:

C:\Windows\System32\drivers\etc

To reset the Hosts file, open File Explorer, type the following in the address bar and hit Enter:

%systemroot% \system32\drivers\etc

Rename the hosts file to hosts.bak. You may be required to take ownership of the file first.

Next, create a new default Hosts file. To do so, open a new Text file named hosts in the folder %WinDir%\system32\drivers\etc folder.

Copy-paste the following text into the notepad file:

# Copyright (c) 1993-2009 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

Save the text file. Alternatively, if you wish you can download the default Hosts file of Windows 8 by clicking here. Extract the contents and place the hosts file in your C:\Windows\System32\drivers\etc folder. You may be asked for permissions to replace it.

HostsMan is good freeware utility that lets you add, remove entries and generally lets you manage the Hosts File in Windows easily. Go here to see how you can Lock, Manage, Edit Hosts File in Windows 8 | 7.

Posted by on , in Category Security with Tags
Anand Khanse aka HappyAndyK is an end-user Windows enthusiast, a Microsoft MVP in Windows, since 2006, and the Admin of TheWindowsClub.com. Please create a System Restore Point before trying out any software & be careful about any third-party offers while installing freeware. Add me on Google+.
  • whatdoesitwant

    I checked, but on my windows 7 RC build 7100 hosts does not live in %systemroot% \SysWOW64\drivers\etc.
    It does exist in %systemroot% \system32\drivers\etc however.

    Am I correct to assume that I should no longer set up my localhost aliases in the hosts file but rather directly in the dns client of the Microsoft Management Console (gpedit). If so, how?

  • david

    i think it’s not good solution because host file is configure as default setting. Rename host file may be crash system. My good solution is

    1. Open Notepad with Administrative privileges by clicking Start, All Programs, Accessories, and then right-click Notepad and select to open as Administrator.
    2. Now that Notepad is open with Administrative privileges browse to (C:\Windows\System32\drivers\etc) in Notepad and open the hosts file.

  • http://www.thewindowsclub.com/ Windows Club

    You can set up localhost aliases in the hosts file.

    In x86, Hosts file is situated in %systemroot% \system32\drivers\etc folder.

    This is the recommended way to set the Hosts file to default.

    Incidentally, there is now also a ready FixIt solution from Microsoft here: http://support.microsoft.com/kb/972034 .

  • Recent Comments