When you think of a local computer hosts file, think of it as a plain-text, the human readable file created for an operating system to map IP addresses to host names on an IP network. The host’s 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 uses the mapped IP address to connect to the website. While translating the name to IP, the local host’s 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 a host 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’s local hosts file and you want to reset it to what it was created the steps below will show you how to do that. To get started, 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 administrator’s group can make changes to the local host’s file. If you’re not an admin, you won’t be able to save the file. Below is the default content of the Windows local hosts file. This is content that comes with all Windows computers. Simply copy the lines below and paste them into the file. I will show you below.
Reset Windows Hosts file
Since only the 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 host’s 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 same location. That should do it! Conclusion: 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.