When you think of a host file, think of it as a plain-text file used by the operating systems to map IP addresses to the hostname on the local computer. The host’s file has priority over DNS. When you type a domain name in your browser to go to a website, your computer translates the domain name your typed into an IP address and connects to the server that hosts 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.

Open Windows 10 Hosts File

The process of editing Windows 10 host files is simple. To add an entry or modify the host’s file, simply open the host’s file at the path below using Notepad or any other text editor. A similar line below should appear in the file. Changes you make to the host’s file take effect immediately. If you want to undo changes to the host’s file, simply open the file and remove the lines you added or precede the line with a # to ignore it.

Add Host Records

On Windows systems, the host’s file must be opened as an administrator. If the host’s file is not opened as an administrator, it won’t allow changes to be saved. To open as an administrator, follow the steps below:

Press the Windows key and type Notepad in the search field. Right-click on the Notepad icon and select Run as administrator. In Notepad, click File then Open. In the File name field, paste c:\Windows\System32\drivers\etc\hosts

For example, to add an entry to translate 127.0.0.1 to example.com, open the host’s file and add its entry by scrolling down to the end of the file and add your new entries: Save the file and exit. As we said above, the changes take effect immediately. You will be able to example.com in your browser as soon as you save the file. Conclusion: This is how one adds or modifies Windows 10 hosts file entries.