Editing the hosts file
One easy way to edit the hosts file is using the freeware Windows program HostsMan.
HostsMan is a freeware application that lets you manage your Hosts file with ease
In Vista / Windows 7 it needs to run with administrative privileges, but it doesn't require going into safe mode.
You can find the IP addresses of the sites using ping
in command prompt or use a lookup tool. Also make sure you tackle all of the combinations:
111.111.111.111 a.com
111.111.111.111 www.a.com
111.111.111.111 222.222.222.222
The file is read only, you can edit it by right-clicking and going into properties, then turning off read-only temporarily until you're done editing.
You should be able to edit the hosts file with Notepad, but it is a protected file by default in Windows Vista. You probably couldn't save the file because of permissions issues, not because it was in use.
To edit the file with Notepad, open it under the Administrator account, by right-clicking Notepad in your Start menu and choosing the Run as Administrator
command.