Simplify your business
Wednesday, 7 January 2009 4:26 pm

The local hosts file trick

Monday, 30 January 2006  

There’s a old but effective trick to block those annoying ads, banners. cookies and hijackers. When your computer makes a TCP/IP request, it first attempts to use your local hosts file before it looks at any public DNS servers, so it can translate the nice (human readable) domain names to numeric IP addresses.

The idea is to use this file to “map” any website you want to block to an “internal” address, thus making your browser think the data actually sits on your own computer, instead of the server you’re trying to block.

The hard-working (but knowledgeable) volunteers at MVPS have a regularly maintained hosts file, which you simply download and copy to the appropriate directory.

If you’re running Windows XP, the file should be /windows/system32/drivers/etc/hosts. If you’re running Windows 2000, it should be /winnt/system32/drivers/etc/hosts instead. Note that the file name is “hosts”, not “hosts.txt” or any other extension. If you want to know more about the trick, read the Blocking Unwanted Parasites page. Users of other operating systems, please see this entry from Wikipedia.

The current version blocks some 10,000 dire, distasteful, and dodgy hosts.

Posted in Security, Software, Web, Windows by Ivan
Blinklist icon Del.iocio.us icon Furl icon Reddit icon Technorati icon Yahoo! icon

Got something to say?

To protect your privacy, your email address will not be displayed.





Some basic rules for commenting:

  • Watch your language.
  • Please keep your comments relevant and on-topic.
  • You can use basic XHTML tags for formatting and linking but not bbcode.
  • Comments are moderated, so please don't double post if your comment doesn't appear immediately.
  • Your comments may be blocked or marked as spam if they appear intended for SEO purposes.
  • Please proof-read your comments for spelling and grammatical errors.
  • Watch your language.