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 (220.127.116.11).
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 in Windows 10 is to open the file using Notepad as an Administrator.
1. Click on the Start button > type Note in the Search box > right-click on Notepad and select Run as Administrator option.
2. On the next screen, type your Admin Password and press the Enter key.
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. To View Files in “etc” Folder, use the Down Arrow to switch to All Files view.
6. Once the Files are visible, select hosts file and click on the Open button.
7. After making changes to Hosts File > select the File tab and click on Save.
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.