Mondoze Knowledge Base

Search our articles or browse by category below

Windows 7, How to edit hosts file

Last modified: October 8, 2022
You are here:
Estimated reading time: 1 min

How to edit hosts file in Windows 7

Hosts file is a file where you can manually enter a hostname and IP address pair to bypass the DNS server.

By default, you cannot see the hidden file in the system folders. The hosts file is used to map hostnames (in other words domains) to IP addresses. With the hosts file, you can change the IP address that you resolve a given domain name to. This change only affects your own computer without affecting how the domain is resolved worldwide.

To show hidden folders in Windows 7, open a windows explorer, click the “Organize” drop-down button and select “Folder and search options”.

windows 7 folder and search options

First, from the Folder Options, choose “Show hidden files, folders, and drives, press Apply and OK to save the setting.

windows 7 folder option

Second,  access to hosts file’s directory to make the change.

May open with cmd, %systemroot%\system32\drivers\etc\

or access to My Computer -> C drive ->  Windows -> System 32 -> drivers -> etc

hosts file

Third, double-click host file to open and edit the file.


Then, note that this method for editing the Hosts file will not work. You will get a message saying you do not have permission to save to this location.

windows 7 permission message

Besides that, In order to edit the hosts file, you have to click Start button and type in Notepad and then right click and choose Run as Administrator to open the hosts file.

windows 7 run as administrator

Now navigate to drivers/etc/ folder again and make sure to choose. All files for File Types otherwise you won’t see the Host file.

windows 7 file type

Make your changes and click save to save all your changes. You will not get the error about not being able to modify the Host file.

You can learn more about web hosting here.

Was this article helpful?
Dislike 0
Views: 206