Edit your hosts file quickly

edit hostfileEverybody who has ever migrated to a new hosting provider, purchased a new domain name or made DNS changes has done it: adding lines to your hosts file to “hard code” the ip address of a server host name on the workstation you are working on.

On Windows, this has become a pain since the UAC feature was introduced. In order to modify,  you need elevated permissions, so you need to start your favorite text editor as administrator. On top of that, the file is buried somewhere in the deepest cave of your c-drive (C:\Windows\System32\drivers\etc\).

There must be an easy way to do this. I managed to reduce it to two clicks via a shortcut on my desktop, with the procedure below. Who can do better? One click only?

  1. Right-click your desktop
  2. In the context menu, select New > Shortcut
  3. In Type the location of the item, enter C:\Windows\System32\notepad.exe C:\Windows\System32\drivers\etc\hosts
  4. Click Next
  5. In Type a name for this shortcut, type any name you want (I used Edit hosts file)
  6. Click Finish
  7. Right-click the new icon on your desktop and select Properties
  8. On the Shortcut tab, click the Advanced button
  9. Check Run as administrator and click OK
  10. Click OK

Seems to be a lot of work, but it will save you numerous clicks whenever you need to edit the file again.

Share

Leave a Reply

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