This brief tutorial shows students and new users how to reset Windows 10 local hosts file to the default settings.
When you think of a local computer hosts file, think of it as plain-text, human readable file created for an operating systems to map IP addresses to host-names on an IP network. The hosts file has priority over domain name systems (DNS).
When you type a domain name in your browser to go to a website, there’s a file or system somewhere that has the domain name mapped to an IP address that your computer can read. Your computer use the mapped IP address to connect to the website.
While translating the name to IP, the local hosts file is the first file your operating look at. If the IP to domain mapping isn’t included in the host file, then it looks up a DNS server online. This is how the process works.
When you’re dealing with hosts file, the IP address and the domain or hostname should be separated by at least one space or tab. The lines starting with # are comments and are ignored.
If you have edited your computer local hosts file and you want to reset it to what it was originally created as, the steps below will show you how to do that.
To get stared, continue below:
Windows 10 Hosts File
Windows local hosts file is located at the path below. All you need is a text editor to open the file and copy/paste the default file content.
First, only the administrator or members of the administrators group can make changes to the local hosts file. If you’re not an admin, you won’t be able to save the file.
Below is the default content of Windows local hosts file. This is content that comes with all Windows computer. Simply copy the lines below and paste it into the file. I will show you below.
# 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: # # 22.214.171.124 rhino.acme.com # source server # 126.96.36.199 x.acme.com # x client host # localhost name resolution is handled within DNS itself. # 127.0.0.1 localhost # ::1 localhost
Reset Windows Hosts file
Since only administrator can edit the host file, search for and open Windows Command Prompt app as administrator as shown in the image below.
When the Command Prompt opens, type in the commands below, then press Enter to open the hosts file in Notepad.
This will open the local host file as administrator. Now simply copy the entire default hosts file content above and paste it into the Notepad.
After copying the content, click File –> Save from the top menu as shown below. Then save and replace the existing file in the save location.
That should do it!
This post showed you how to reset Windows local hosts file to its default. If you find any error above, please use the comment form below to report.