Last Updated on February 25, 2024 by Mathew Diekhake

Some people will need to edit the hosts file on occasion. It might be because of an attack or prank or because you want to block malware, adult content, or other websites.

Hosts files are not unique to Windows—you’ll find them on Mac and Linux as well—and they have been around since ARPANET (in other words, ever since the first TCP/IP protocols). The hosts files are similar across all platforms, so if you have used it before with Mac or Linux, you will not have any problems with Windows. One of the reasons for their similarities is that Microsoft kept the hosts files alive with Windows networking.

You can use hosts files to block any unwanted connections—it was popular among unethical nerds to use hosts files to block ads all over the internet before ad blocking extensions became common, for example. But you can use hosts files to help with Web development as well and more productive things. Developers sometimes wish to make a local computer resolve a domain to a local address. You can also get access to a device from File Explorer if you map a network to its IP address with its hosts file.

The hosts file is a regular text file that can be modified with the text editor. It’s more about what is in the hosts file that is the important part. The only difficult part for some is you need to be logged in as an administrator before you can use the hosts file located in the system directory. Given its system directory location, apps without elevated administrative permissions will not be able to save it.

Here is what you need to edit the hosts file when using a version of the Windows 10 operating system.

How to Edit Hosts File in Windows 10

You can edit the hosts file from the C:\Windows\System32\drivers\etc path. Here is how to do that:

1. Open the Start menu.

2. From the list of All Apps, click on Windows Accessories.

3. Right-click on the Notepad app, hover over More, and then click Run as administrator.

4. With Notepad open, click on File and then navigate to the C:\Windows\System32\drivers\etc path.

Note: This is not an example but the actual path to follow and when you do you will then see the hosts file.

5. Click All Files from the drop-down menu and then click hosts file.

In conclusion, that is how to edit the hosts file in Windows 10.