Thursday 6 February 2014

How to edit the hosts file in Windows 7

In windows XP it was possible to edit the hosts file directly by going to C:\WINDOWS\system32\drivers\etc\hosts and editing in notepad. However, in Windows 7 it’s not so easy. DNS

I’m guessing you have landed on this page because you know what the hosts file is and want to change it. However, for those that are unsure – the hosts file is where you can manually enter a hostname and pair it with an IP address, thereby bypassing any DNS server. This is useful for IT professionals who can be faced with complex routing scenarios.

To follow the normal Windows XP method on Windows 7 you would have to make the relevant folders visible. These folders are hidden by default as 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.

clip_image001

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

clip_image002

When you have confirmed by clicking OK go to the hosts file at C:\WINDOWS\system32\drivers\etc.

clip_image001[4]

When you try and edit the Hosts file it will not work and you will get a message saying you do not have permission to save in this location. “C:\WINDOWS\system32\drivers\etc\hosts.txt. You don’t have permission to save in this location. Contact the administrator to obtain permission”.

clip_image001[6]

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.

clip_image002[4]

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.

clip_image003
Once the hosts file is open in administrator mode via notepad you are free to edit the file as you wish. Save all the changes and they will be applied.









No comments:

Post a Comment