Wednesday, July 11, 2012

Repair Windows 7 Hosts File

Windows 7 comes with an odd quirk: the hosts file is ignored. For those of you who may not know what the hosts file does, it contains a list of network addresses and allows you the flexibility to block them or change them. Malware can invade this file and wreak havoc on your internet connection. There are websites that contain custom hosts files that allow you to block internet advertising (like SomeoneWhoCares.org). It's a useful tool for network administrators. It befuddles me why Win 7 has this problem, though I can speculate. Perhaps it's a part of Windows security. Maybe the original hosts file is corrupt. Whatever the reason may be, Windows 7 is ignoring it.

The fix is so easy, it's almost laughable. Simply delete the old one and replace it with a new one. That's all there is to it. To do it, you will need administrative privileges. Log in as administrator. Open the directory C:\Windows\System32\drivers\etc\ in Windows Explorer. Right-click the "hosts" file and select "Open file". If prompted, select "Notepad" as the program to open it. Select all and copy. Minimize the window. Now open up Notepad as administrator (right-click >> Run as administrator) and copy the contents into a new file. Close the minimized copy. Go to Windows Explorer and delete the "hosts" file. Go back to Notepad, click "File >> Save As", navigate to C:\Windows\System32\drivers\etc\, and save the file as "hosts" without any extension (not "hosts.txt", just "hosts"). That's it. Problem solved.

No comments:

Post a Comment