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