How to edit Hosts file in windows os

Windows 7 – Edit the Hosts File

November 8th, 2009 by Aseem Kishore | File in: Windows 7

Need to figure out how to edit the Hosts file in Windows 7? For the most part, it’s pretty much the same as Windows XP and Vista, but with a few extra hiccups!

Just if case you don’t know, the Hosts file is where you can manually enter a hostname and an IP address pair, thereby bypassing the DNS server. This can be pretty useful in certain situation, especially for anyone in IT.

The path to the Hosts file in Windows 7 is the same as usual:

%systemroot%\system32\drivers\etc\

where %systemroot% is usually c:\windows unless you installed Windows on a different partition. By default, you cannot see these hidden folders since they are system folders.

To show hidden folders in Windows 7, press the ALT key while in Explorer to bring up the File menu. Click on Tools and then Folder Options.

hosts file windows 7

Click on the View tab and then click on the Show hidden files, folders, and drives radio button under Hidden files and folders.

show hidden files windows 7

Now navigate to the directory above and open the hosts file and make your changes.

edit hosts file

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 in this location.

windows 7 hosts file

In order to edit it, you have to click on Start, type in Notepad and then right-click on Notepad and choose Run as Administrator.

run as administrator

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

view all files

Make your changes to the Hosts file and click File and Save to save all changes. Now you will not get the error about not being able .

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s