Wednesday, December 02, 2009

Editing HOSTS File on Windows 7

HOSTS file is a file that contains the mappings of IP addresses to host names. It's used by Microsoft TCP/IP for Windows or TCP/IP for Linux.

If you're a developer or programmer or even an administrator, i'm sure you will often edit this file. You can found this HOSTS file on C:\Windows\System32\drivers\etc\hosts (for Windows XP, Windows 2003 Server, Windows Vista, Windows 7) or on /etc/hosts (for Linux family).

In previous Windows version (Windows XP or 2003 Server), you can change the content of this HOSTS file and simply save your changes without problem. But, if you try to edit this HOSTS file on Windows 7 you will face an error something like this "This is a read-only document".

The solution is simple. If you are using Notepad or EditPlus or another editor application to edit this HOSTS file, make sure that you run the Notepad or EditPlus as an Administrator.

The question now is how to make sure that my editor application is run as administrator?

Ok. This is a sample if you're using Notepad as an editor.

Go to Start -> All Programs -> Accessories. You will see the Notepad icons there. Right-click on Notepad and choose "Run as administrator". Then open the HOSTS file using that Notepad.

And now you can edit your HOSTS file without problem.

No comments: