Windows 7: How to edit hosts file


To edit the hosts file on a Windows 7 system just follow the instructions below:

  1. Press Windows-Key or click on Windows icon
  2. Search for “cmd.exe
  3. Press Strg+Shift+Return or right click on cmd.exe and select “Run as administrator”
  4. Confirm the Windows UAC dialog.
  5. Run
    notepad %systemroot%\system32\drivers\etc\hosts
    
  6. Edit the hosts file and save the changes
  7. Close the notepad editor and the command line prompt
,

6 responses to “Windows 7: How to edit hosts file”

  1. Hi,

    Sorry, I tried your method but it did not work. I’m been searching for answer on google; unfortunately, I haven’t found one, yet. I even logged on the system as Administrator. Please advise.

    Thank you,

  2. Step 1. Open your Windows start menu, search for the notepad application and then right click the notepad icon.

    Step 2. Choose “Run as administrator” and then, while inside notepad, ( from file -> open ) browse to folder (/windows/system32/drivers/etc) that contains the hosts file.

    now edit and save ! when you want to save don’t forget to brows All File Types so find hosts click on Hosts File and when it asked you to save on excited file, click yes.

  3. When saving the file with the “save as” dialog, you have to select “All files (*.*)” as file type. As an alternative you can surround the file name with double quotes.

  4. Hi ive had to do this everytime i reinstall windows but i keep forgetting how to correctly edit my hosts file

    -_- this method doesnt work for me it seems windows ends up ignoring the hosts file entirely after i changed it

    open as admin edit as admin saves as a host file (not a txt file) registry is pointing to the hosts file correctly

    but when i ping the entry it doesnt change; any clues?

Leave a Reply

Your email address will not be published. Required fields are marked *