QuestionWhat is a HOSTS file?
AnswerA HOSTS file redirects things from a site you specify to the IP address you mention. This is a very effective popup blocker, and it provides a fairly effective barrier against malware. Your HOSTS file can be set to send things from a multitude of sites to 127.0.0.1, a non-existent IP address.
How it worksWeb pages look at a HOSTS file before displaying a page. This is nearly instantaneous. Anything not covered in the HOSTS file is displayed. This is why it's such a good popup blocker; if the domain is mentioned, it is blocked.
The location of your HOSTS fileThe following are the defaults:
Windows XP: C:\WINDOWS\SYSTEM32\DRIVERS\ETC
Windows 2000: C:\WINNT\SYSTEM32\DRIVERS\ETC
Windows 98/Windows ME: C:\WINDOWS
Blocking sitesTo block a site, open your HOSTS file in Notepad and add lines. To block MSN.com (not recommended), type this on a new line:
127.0.0.1 www.msn.com
msn.com is officially blocked. But, I'd remove that if I were you.
Stopping as many as possibleSure, you could manually enter sites. But a lot of them you don’t even know about. It’s usually best to download a HOSTS file from a site that frequently updates their HOSTS file. A good site is
this one. It updates frequently, and their HOSTS file is currently about 440 KB. That’s a lot of blocked ads, a lot of stopped malware!
UpdatingIt’s not enough to have a HOSTS file – it must be
maintained. I recommend
HOSTS Secure. It can run at Windows Startup (minimized if you prefer), and it will automatically update (but you have to push the button to start the search), keeping your HOSTS file up-to-date. Note that you need
.NET Framework 1.1 to run it.
Your HOSTS file is not a replacement for AntiVirus, firewalls, or other protection. However, a HOSTS file backs you up, basically watching the firewall’s back in case something slips through.