floppyfw
hosts file

Archival page … no longer updated.

hosts file how to

Intro to host file blocking

Its like this. Every computer, regardless of Operating System (OS), Windows or Linux or Unix or blah blah, has a file somewhere called a hosts file.

In Linux, it is typically located on /etc/hosts while on Windows XP you'll find it on c:\windows\system32\drivers\etc\hosts and there are variations depending on your version or "flavor" of Windows.

This hosts file although seemingly innocuous and relatively empty by default, possesses a lot of potential POWER that most folks don't know or care about. It can block or filter or prevent a web site from displaying anything on your computer with a little simple manipulation. In addition to this, it will also prevent the bandwidth that would normally be required to display whatever image is blocked by the hosts file from being used or wasted at all. This translates into better performance for the things you do wish to see! Pretty cool so far eh? Well, in this example, lets say an advertisement server named ads.annoying.com is pumping out annoying banner ads and motor oil ads that are popping up all over your screen while you browse your favorite my.rocket.science.com web site. If you have a hosts file and edit the following information into it:

127.0.0.1 ads.annoying.com

Here is what happens next. The ads served by the ads.annoying.com server, will no longer show up on your pc at all. In fact, any ads that are imbedded on the page on my.rocket.science.com that you are browsing, that are served by that named ad server won't ever be requested by your pc since it believes (due to the hosts file entry) that they are already here on your pc (127.0.0.1 maps them to your local host pc). They won't get requested and there will be no bandwidth used to download them since they are not requested. That is the simple, basic principle that host file based blocking and filtering works by.

Simple is elegant … =)
Now for the gritty part called implementation details:

To block ads, malware, spyware and more using a hosts file blocking scheme, for a single Windows OS based PC, there are more resources and information on how to do that at the following two sites:

     A relatively small, very effective hosts file implementation (highly recommended).

     http://www.mvps.org/winhelp2002/hosts.htm

     A very large, very effective hosts file, but may be too aggressive for home use.

     http://hostsfile.mine.nu

To block ads, malware, spyware and more using a hosts file blocking scheme, for a whole network, blocking hosts at the firewall - router using floppyfw and dns based blocking may be the answer that will work best for you. You can find more information and resources to do this here:

     Ad-blocking package for floppyfw


Updated: 03-Jan-2012