If you ever come across the need to make changes to the Hosts File on your computer, you will find below an easy method to open and Edit Hosts File in Windows 10.
Edit Hosts File in Windows 10
The original purpose of the Hosts File was to Map IP Addresses to their human friendly hostnames or domain names.
For example, it is easier to remember and type google.com in the browser search box, compared to remembering the IP Address of google.com (22.214.171.124).
While the domain mapping function is currently being performed by DNS Servers, the Hosts File still exists on both Window and Mac computers.
The default Hosts File on your computer is located at C:\Windows\system32\drivers\etc path and it only contains a few comment lines staring with ‘#’ character.
Why Edit Hosts File?
While most users never come across the need to edit Hosts File, some users Edit the Hosts File to block certain websites on their computer.
For example, you can prevent Facebook from being accessed on your computer by mapping facebook.com to an incorrect IP Address.
Similarly, you can totally bypass the DNS server by mapping your favourite websites in the Host File to their correct IP Addresses.
You will also be looking to inspect Hosts File, in order to rule out the possibility of Hosts File being edited by a malware program.
1. Edit Hosts File Using Notepad
The easiest way to Edit Hosts File on your computer is to open the file using Notepad as an Administrator.
1. Click on the Start button > scroll down the list of Apps and expand Windows Accessories entry.
2. Right-click on Notepad > select the More option and click on Run as administrator.
3. In untitled Notepad, select the File tab and click on Open.
4. In Open File dialogue box, type C:\Windows\system32\drivers\etc as the ‘File Name’ entry.
Note: Alternatively, you can navigate to C:\Windows\system32\drivers\etc using the left pane menu.
5. Using the down-Arrow, switch to All Files and you will be able to see files in ‘etc’ folder.
6. Select hosts file and click on the Open button to open Hosts File in Notepad.
7. Make changes as required to the hosts file and Save the file.
As you can see in above image, you can block any website on your computer by mapping its domain name to localhost (127.0.0.1) or 0.0.0.0.