Using the Hosts File and Junkbuster Proxy to filter out adbanners

There are two excellent tools out there for Windows users to utilize in the case they want to remove adbanners from their general websurfing experience.

Hosts files: General
The first is using a Windows Hosts files to "misdirect" known advertisers and thus prevent their bannerads from loading. Hosts files have been around as long as networking has. Originally, all computers which connected to a network had to have a file which associated a name with a particular IP address. If a name was not on in the file, a user could not contact that computer. This idea was scrapped in favor of DNS, where a users computer will query their ISP who will query another computer, etc. for the IP address associated with a certain domain. However, web browsers are still configured to go through the Hosts file before querying anyone else. So it is possible to associate a bunch of invalid IP references with known advertisers. Perhaps the best invalid IP address to use is 127.0.0.1, which is a reserved IP. It is known as the loopback reference, and anytime it is queried, the query won't leave your computer. However, spoofing the Hosts file won't work if the adbanner's reference uses the actual IP.
Hosts files: Specific
The Hosts file is usually located in the c:\windows or c:\winnt folder. It is a plaintext file that is simply called "Hosts", with no file extension. If you plan on using the Hosts file for the following purposes, I highly recommend you check to see if you have a file first, and if you do, what is the content of it.
Some general rules for Hosts files:
  1. Putting a # in a line will comment out the rest of the line, which means the rest of the line will be ignored.
  2. Hosts files do not accept wildcards. If you don't know what wildcards are, don't worry. It just means that you have to create a seperate entry for every known adserver. (example, img1.doublick.com would have to have a seperate entry from img2.doubleclick.com and img99.doubleclick.com)
  3. Spoofing a domain's IP using the Hosts file will still allow your computer to access subdomains.
  4. The format of an entry in the Hosts file is along the lines of: 127.0.0.1     ads.doubleclick.com
  5. It doesn't matter how many spaces you put between the IP and the domain, as long as there are spaces, and you're consistent with the other entries.
  6. Hosts can only be used to spoof an entire domain, not just one single site or image.


Now that you know enough to actually do this, you can begin to create your own lists of blocked adservers. Or you can download mine and modify it to your needs (Remember: you need to remove the file extension before it can work!) If using my Hosts file causes you to be unable to get to websites you want to go to, you can either a) search the file to see if the domain is listed and then delete or comment out the reference or b) delete the Hosts file. If a Windows Hosts file is not present, the browsers and other networking programs will just use DNS.


Using Junkbuster's Proxy

You can download the junkbuster proxy at junkbuster.com

Many people have pointed out that Junkbuster is not a proxy, because it doesn't access the pages directly, but rather acts as a filter to get rid of whatever people want to get rid of. Junkbuster works in a similar vein as the Hosts file, but it's slightly trickier. The heart of the proxy is a user-defined "blockfile" or "rules" list. Many companies set up their adservers to be named or their banner ads have file names that are along the same lines, only a character or two off from each other. Junkbuster is smart enough to recognize this, and thus you can add a single "rule" to the blockfile which can potentially block hundreds of images.

Some important things about Junkbuster:
  1. Unlike Hosts, which is very easy to use because Windows uses it by default, you have to "tell" your browser that they need to go through Junkbuster before they attempt to access any websites. This can be done through the Preferences or Options menu. Then under "Automatic Proxy Configuration," or something of that kin, type "127.0.0.1" (without the quotes.) This will tell your browser to look for the proxy on the local machine. Beware of these proxy settings though: when Junkbuster is not running, your browser and any program that uses its proxy settings will not be able to work, because it is looking for Junkbuster. For example: Outlook Express, Juno Web, and the LiveJournal update client all use IE's settings.
  2. When you first download the proxy, the blocklist will be nearly empty and thus won't filter anything out. You need to add rules to your blocklist. You can find blocklists on the internet (many people post them to their websites), create your own from your own experiences, or download and change mine. (You have to rename it sblock.ini and move it to the folder where you installed Junkbuster.)



previous        main        next