≡ Menu

How to edit host file in XP/Vista/Windows 7?

Windows edit host file

Spread the love

Reading Time: 2 minutes

Host file is a file inside windows operating system which is used for mapping hostnames to IP address. Editing the host file is done rarely unless you have an issue with the host file. Malware programs often attack host file to make the web browsers redirect to malicious websites or IP address. In such cases, it becomes important to edit host file to get rid of these suspicious entries. In this tutorial, you will learn how to make changes or edit the host file.

Location of Host file

The host file is located in the same folder in WinXP, Vista, and Win7. You can directly open the file from the location C:\Windows\System32\Drivers\Etc.

You can also open the location by entering the location in “Run” window

Click Start -> Run -> type %systemroot%\system32\drivers\etc\

windows host file in run window

How to open and make changes in Host file

Right click on host file -> Open -> Select Notepad ->Click OK.
This will open the host file using a notepad. You can now start making changes.

How to save the changes made on Host file?

If you are logged in as an administrator user in WinXP, there are no additional steps. Just open the host file using notepad, save the changes normally as you usually do in notepad.

Vista and Win7 won’t allow making changes to host file because of the additional security provided to these files. Even if you are logged in as an administrator user, you still need to open the file with admin rights to make the changes.

  • Right click on the Host file
  • Click Open
  • Select “Run as Administrator

Now you should be able to save the changes made on the file.

If you try to make changes without administrator rights, you might end up with a message as shown below.

host file permission error windows
Spread the love
{ 5 comments… add one }
  • FelixINX June 14, 2014, 8:09 pm

    You can save the hosts files by open the notepad as admin. The open the hosts file save in your documents. After, save as to the etc directory. Remember to choose all files, not txt.

  • Esteban December 22, 2013, 9:39 am

    When I open Host file I can’t find anything to run as administrator.

    • Anup Raman December 22, 2013, 10:06 am

      Some computers may not have host file. There are chances the file got deleted while removing temporary files by system optimization software. It is not an essential file. It’s okay if you don’t have the file.

  • Michael Ferber November 29, 2012, 12:59 am

    When I click on etc there is no Hosts file, the othere 4 are there but not that one??? I’ve searched for it numerous times and can’t find it to edit the file. Any suggestions? Thank you for your help the video is very informative and I think it will fix the problem if I could find the file.

    • Anup Raman November 29, 2012, 5:07 pm

      First of all, nothing to worry about not having hosts file inside computer. There are scenarios when hosts file gets deleted from computer, most of the times accidentally.It’s okay not to have the host file in computer.

      There are certain softwares which may require you to make changes in host file as part of its configuration.In those cases,you can get a healthy host file from another computer and put it inside the drivers location.

Leave a Comment