Reset Windows 10 Hosts File: Recreate it With These Steps

Easy manipulation of the Windows hosts file

by Ivan Jenic
Ivan Jenic
Ivan Jenic
Troubleshooting Expert
Passionate about all elements related to Windows and combined with his innate curiosity, Ivan has delved deep into understanding this operating system, with a specialization in drivers and... read more
Reviewed by Alex Serban
Alex Serban
Alex Serban
Windows Server & Networking Expert
After moving away from the corporate work-style, Alex has found rewards in a lifestyle of constant analysis, team coordination and pestering his colleagues. Holding an MCSA Windows Server... read more
Affiliate Disclosure
  • This file is essential in mapping hostnames to IP addresses on the Windows 10 operating system.
  • Upgrading to a new version of Windows, malware infection, and incorrect edits are reasons to edit the file.
To fix various PC problems, we recommend Restoro PC Repair Tool: This software will repair common computer errors, protect you from file loss, malware, hardware failure and optimize your PC for maximum performance. Fix PC issues and remove viruses now in 3 easy steps:
  1. Download Restoro PC Repair Tool that comes with Patented Technologies (patent available here).
  2. Click Start Scan to find Windows issues that could be causing PC problems.
  3. Click Repair All to fix issues affecting your computer's security and performance
  • Restoro has been downloaded by 0 readers this month.

The hosts file is an essential component of your computer. If it has changed for some reason, don’t panic, you can quickly reset Windows 10 hosts file.

So, in this article, we’ll explore some common triggers of host file changes and show you how to set the default values for this file on the MS operating system.

What is a Windows hosts file?

The Windows hosts file is a text file in the Windows operating system that maps hostnames to IP addresses. It acts as a local DNS resolver and allows you to map domain names to IP addresses manually. 

This file is usually used to block or redirect network traffic and can be helpful in a variety of scenarios, such as:

  • Blocking ads – You can add entries to the hosts file that point to the IP address of ad servers, effectively blocking all ads from displaying in your browser.
  • Website testing – You can use the hosts file to test a website before it goes live by pointing the domain name to a specific IP address.
  • Redirecting traffic – You can redirect traffic from one domain name to another by pointing the domain name to a different IP address in the hosts file.

However, sometimes the hosts’ file can become corrupted or modified by malware, which can cause issues with network connectivity. 

Expert tip:


Some PC issues are hard to tackle, especially when it comes to corrupted repositories or missing Windows files. If you are having troubles fixing an error, your system may be partially broken.
We recommend installing Restoro, a tool that will scan your machine and identify what the fault is.
Click here to download and start repairing.

In such cases, resetting to its default state can be helpful. Here are some common reasons why someone may want to reset this file:

  • Malware infection – Malware can modify the hosts file to redirect your web traffic to malicious sites or block access to legitimate sites. Resetting the hosts file can help to remove these malicious entries and restore normal network connectivity.
  • Incorrect manual edits – If you have manually edited the hosts file and made an error, this can cause issues with network connectivity. Resetting the file can help to remove any incorrect entries and restore proper functionality.
  • Upgrading to a new version of Windows – Upgrading to a new version of Windows can sometimes cause issues with the hosts file. Resetting the file can help resolve compatibility issues and restore normal network connectivity.

How do I reset my hosts file in Windows 10?

  1. Press Windows + E to open File Explorer and enter the following location:
    • C:\Windows\System32\drivers\etc
  2. Find hosts file, and rename it to host.bak (You may be required to take ownership of the file first).
    reset windows 10 hosts file
  3. Press Windows + R, type Notepad, and hit Enter
  4. Paste the following text in Notepad:
    • # 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:
      # # source server
      # # x client host
      # localhost name resolution is handle within DNS itself.
      # localhost
      # ::1 localhost
  5. Click on File, then Save As.
  6. Save it to the path below as hosts:

How do I edit and replace the host file in Windows 10?

  1. In Windows search, type notepad, right-click on it, and choose the Run as administrator option.
    reset windows 10 hosts file
  2. Now select File, then Open in your Notepad. Then navigate the path below, click on the hosts file, and choose Open.
    reset windows 10 hosts file
  3. Now, you should be able to make the changes to your hosts you want to, and simply click on save when you are done.

Your hosts file is now back to its default values, but creating a backup copy of the hosts file is recommended, so you can easily replace it again if needed. For example, you can use your old hosts file as a backup and keep it in the Drivers folder next to the original.

Resetting your hosts file is a beneficial solution for fixing connectivity issues on your Windows computer. So, if your Internet connection is not as stable as it should be, use this method to fix it.

It is worth mentioning that your hosts file may sometimes be locked for editing. If this is the case, we’ve got your back. We have already compiled a list of solutions for this particular issue, which you can check in this guide.

Please use the comments section below if you have any comments or suggestions.

This article covers:Topics: