How to reset HOSTS file to default on Windows 11

Yes, you can reset the Hosts file, and here's how on Windows 11.

Windows 11 reset Hosts file
  • To reset the “Hosts” file on Windows 11, open Notepad as an administrator.
  • Copy and paste the original settings.
  • Create a backup of the previous file.
  • Save the new Hosts file in the “%WinDir%\System32\Drivers\etc” location.

On Windows 11, if you made changes to the “Hosts” file, you can quickly reset it to its default settings to resolve Domain Name System (DNS) problems caused by editing this file. 

The Hosts file resides in the “%WinDir%\System32\Drivers\etc” path and allows you to map domain or host names to IP addresses. Typically, you don’t have to map addresses on Windows 11 manually. However, it can be useful in many scenarios. For example, when you want to block certain websites. When you don’t have a local DNS server in the network, you must map an IP address to a computer name or prepare a website transfer to a new hosting provider.

The only caveat is that if you make a mistake, you may end up with unwanted networking behaviors. If you notice networking issues after editing the Hosts file or you want to undo previously made changes, it’s possible to reset the file’s configuration.

This guide will teach you the steps to reset the Hosts files on Windows 11. (These instructions should also work on Windows 10.)

Reset Hosts file to default on Windows 11

To reset the “Hosts” file to its default settings on Windows 11, use these steps:

  1. Open Start on Windows 11.

  2. Search for Notepad, right-click the top result, and select the Run as administrator option.

  3. Copy and paste the following text into the 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:
    #
    # localhost name resolution is handled within DNS itself.
    # 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
  4. Click on File and select the “Save as” option.

  5. Browse to the Hosts file location:

    %WinDir%\System32\Drivers\etc
  6. Select the “All files” option in “Save as type” setting.

  7. Right-click the existing hosts file and select the Rename option.

  8. Confirm the hosts.old name to keep a backup of the previous configuration and press Enter.

  9. Use the hosts name in the “File name” setting.

    Hosts reset settings

  10. Click the Save button.

Once you complete the steps, the Hosts file will reset to its default settings, fixing any related problems on Windows 11.

About the author

Mauro Huculak is a Windows How-To Expert who started Pureinfotech in 2010 as an independent online publication. He has also been a Windows Central contributor for nearly a decade. Mauro has over 14 years of experience writing comprehensive guides and creating professional videos about Windows and software, including Android and Linux. Before becoming a technology writer, he was an IT administrator for seven years. In total, Mauro has over 20 years of combined experience in technology. Throughout his career, he achieved different professional certifications from Microsoft (MSCA), Cisco (CCNP), VMware (VCP), and CompTIA (A+ and Network+), and he has been recognized as a Microsoft MVP for many years. You can follow him on X (Twitter), YouTube, LinkedIn and About.me. Email him at [email protected].