The Windows host file is located in “C:Windows\System32\drivers\etc“. In order to edit it, you have to open Notepad with administrative privileges and then open the hosts file.
Although small, the host file is particularly useful since it stores the hostnames and their corresponding IP addresses. It is the one that is queried first before a DNS query on the web address servers. Thus, the host file is a basic tool for a network protocol: it converts hostnames into numeric IP addresses. However, the network can only work with these addresses. It is installed on all common operating systems for PC, Mac, and mobile devices. Only system administrators can edit the host file. Each time you visit a website, your computer first checks the host file to find a matching entry or rule for the page.
Follow this guide to find the location of the host file in windows 10 and see how to use it to block websites or bypass your DNS if it’s blocking certain domains.
Where is the host file located in Windows 10 ?
The windows hosts file location in Windows 10 is “C:Windows\System32\drivers\etc“. If you open your own host file in Windows 10, chances are that you will not find any entries in it. The Domain Name System (DNS) is now used to access websites. However, the host file is still convenient for local (LAN) and virtual (VLAN) networks. Among other things, you can edit the host file to block malicious websites while you are surfing the Internet.
The host file is a very simple text file that can be opened and edited under Windows with Notepad, for example. First, you can see the description of the file by Windows. You can set IP addresses and corresponding hostnames below. The defined IP address is on the same line as the corresponding hostname. It is important that the two pieces of information are separated by at least one space. You can also add comments with the “#” prefix. Blank lines in the text file are ignored.
How to edit the host file in Windows 10
Follow these steps to edit the host file in Windows 10
- Find Notepad in the Start menu and right click on it. Select “Run as Administrator“.
- Once in the Notepad, click on “Open” in “File“.
- Open the “host” file in Windows Explorer that you can find in : C:Windows\System32\drivers\etc .
- Make sure to select “All files (*.*)” in the filetype dropdown so that you can see the host file, otherwise the host file will be hidden.
You now have the possibility to modify the host file.
Note: If you open Notepad without administrator privileges you will NOT be able to save the file after edit.
While most users never encounter the need to modify the Hosts file. Some users modify the Hosts file to block certain websites on their computer.
How to block a website with host file
With host file you can block access to Facebook on your computer by mapping facebook.com with an incorrect IP address.
Similarly, you can completely bypass the DNS server by mapping your favorite websites in the host file to their correct IP addresses.
So, there you have it, a quick and easy way to edit your Hosts File in Windows 10. (It’s the same steps for Windows 7 / 8 or even XP).
What is a host file ?
First of all, the host file is rather a relic of the past. In the early days of the Internet, the file was used to link domain names to certain IP addresses. For example, the host file made sure that the computer could know which IP address was behind www.techlou.com. Therefore, this file contained a long list of these hosts and their special addresses. The influence of the term “host” can still be seen today, especially when we talk about “hosting a website”.
See also: How To Copy and Paste Multiple Items in Windows Clipboard