If you are looking for a way to open and edit “Hosts File” on your Windows computer, it is likely that you want to rule out the possibility of this important File being modified by virus or malware.
The Hosts File can also be used to block access to websites on the computer, which is another reason for users looking for a way to open and Edit Hosts File.
Edit Hosts File in Windows 11/10
The default Hosts File on a Windows computer is located at C:\Windows\system32\drivers\etc path and it only contains a few comment lines starting with ‘#’ character.
Hence, any new lines that you see on the Hosts File without the “#” character have been either added by you or added by adware, virus or malware.
You can find below the steps to Edit the Host File on your computer by opening the Notepad app with Admin rights and navigating to the location of the Hosts File on your computer.
1. Click 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.
In above example, a new entry has been added to the Host File to block Facebook on the computer by mapping its domain name to localhost (127.0.0.1) or 0.0.0.0.