Solving problems with hosts file in Windows 7
Hosts file is responsible for assigning host names to IP address. Using this file you can solve specific tasks, for example: 1) restrict access to certain sites; 2) assigning names for virtual sites if they were developed on a personal computer. However, sometimes when editing this file it can cause some troubles. So, let's have a bit closer look at this file.
Where is the hosts file located in Windows 7?
By default this file is located in the system folder: %systemroot%\system32\drivers\etc, which corresponds on most PCs to: C:\windows\system32\drivers\etc\.
However, it is hidden from prying, in experienced eyes (equals dangerous), and if you don't change the folder settings to: "show hidden and system files", you won't detect it.
How to edit the contents of the hosts file in Windows 7?
To edit the hosts file you should have administrator rights. Otherwise you will only be able to view the contents of the file.
To edit the file, open a simple text editor such as Notepad, and then click "Run as administrator", now open hosts file, do some editing and save it. All changes will become active right after saving.
Why the hosts file stops working in Windows 7?
Sometimes the hosts file just stops working, It's there. It was not deleted. It enthrones its lawful place. No errors present. Still, the hosts file does not work. This "unexplained" phenomenon was observed on PCs with an antivirus running or programs that help create web-servers for site developers, for example Denwer.
This problem is always connected to changes made in the hosts file. The easiest way to solve this problem is as follows. Copy the contents of the file to any document, delete the hosts file and reboot the computer. Instead of the corrupted file the system will generate a default file with the necessary rights, after some more editing you'll able to work with it.