How to edit windows hosts file

Hosts file is the file used by Microsoft TCP/IP for windows. It shows the mapping of the IP address with its corresponding Host name. It helps to access any web site or web page easily. Mapping the IP addresses with their Host names also help to resolve DNS issues.

Hosts file is generally READ ONLY, in other words you cannot modify them in general. To edit a host file, you need to remove it from READ ONLY constraint and then move it anywhere else to edit it. It can be edited using NOTEPAD.

Windows 8 or 8.1

Unfortunately Windows 8 makes it annoying to open apps as administrator — but it’s not too difficult. Just search for Notepad, then right-click on Notepad in the search results list, and choose to run it as administrator

Once you’ve done so, open up the following file using the File -> Open .


Then you can edit as normal.

Windows 7

To access the hosts file in Windows 7 you can use the following command in the Run Line to open notepad and the file.
notepad c:\windows\system32\drivers\etc\hosts

Once notepad is open, you can add any address at the end of the file as show in example below. Once you have done editing press Ctrl + S to save and then you can close the file.


If you are still unable to edit/save your hosts file then do the following NTFS permission settings.

Right Click on hosts file > Security > Users > Edit > Give full access > Apply > Ok

Like This Article ? :

We encourage healthy criticism, so do not hesitate to leave your thoughts in comment box.