To reset the Hosts file to the default value in Windows 10/8/7

RECOMMENDED: Click here to fix Windows errors and optimize system performance

The Hosts file file under Windows is used to map host names to IP addresses. If, for any reason, you determine that your Hosts file has been compromised and malicious entries have been added, you can reset the Hosts file to the default value if you wish.

Reset Hosts file under Windows 10/8/7

January 2021 Update:

We now recommend using this tool for your error. Additionally, this tool fixes common computer errors, protects you against file loss, malware, hardware failures and optimizes your PC for maximum performance. You can fix your PC problems quickly and prevent others from happening with this software:

  • Step 1 : Download PC Repair & Optimizer Tool (Windows 10, 8, 7, XP, Vista – Microsoft Gold Certified).
  • Step 2 : Click “Start Scan” to find Windows registry issues that could be causing PC problems.
  • Step 3 : Click “Repair All” to fix all issues.


The file Hosts file under Windows 10/8/7 is located at the following location :


To reset the Hosts file, open the file explorer, type the following in the address bar and press Enter :

%systemroot% system32driversetc

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

Then create a new Hosts file by default. Open a new text file named hosts in the %WinDir%system32driversetc folder.

Copy the following text into the notepad file :

# Copyright (c) 1993-2009 Microsoft Corp # This is an example of a HOSTS file used by Microsoft TCP/IP for Windows. This file contains IP address assignments to host names. Each entry must be held on a single line. The IP address must be in the first column, followed by the name of the corresponding host. The IP address and host name must be separated by at least one space. In addition, comments (like this one) on individual lines or after the machine name, which is identified by a'#' symbol. Click here to see how to lock, manage and edit the Hosts file under Windows.

RECOMMENDED: Click here to troubleshoot Windows errors and optimize system performance

Related Video