dennis.ca

RSS Feed

Weblog from Ottawa, Ontario, Canada

Blocking Ads and Other Nonsense

February 20th, 2004 · 3 Comments

Do you hate being forced to look at ads while you putter around the web? Me too. For that reason I've been blocking advertising servers with my own compilation of ad server filters for quite some time. The fantastic Firefox (formerly Firebird) browser/AdBlock combination makes this method seem redundant for browsing with its pattern-matching capabilities, but there is still a place for hosts blocking when it comes to overall security (malware, etc.).

In any event, I bring you both filter compilations for your enjoyment. If you have suggestions or additions, please include them in the comments. This entry will always contain the latest versions of both files.

AdBlock Filters Usage

AdBlock Filters (ASCII)
22-September-2005
460 Filters

Using the AdBlock interface within Firefox, import the entries provided here. If you have existing filters in place, please 'append' rather than 'overwrite'.

  1. If you haven't already, install AdBlock (and restart Firebird/Firefox).
  2. Download the AdBlock Filters file.
  3. Select Tools | AdBlock | Preferences from the Firebird/Firefox menu.
  4. Select AdBlock Options | Import Entries.
  5. Import the filters file downloaded in Step 2.

Hosts File Usage

hosts (tab delimited ASCII)
19-April-2005
1330 Entries

Note that I rarely update this hosts file due to the efficiency of AdBlock.

Please make a backup copy of your original hosts file prior to making any changes. I'm providing this information as a courtesy, and probably won't be able to help with individual problems you encounter.

Append the contents of the hosts file above into the hosts file on your own machine. Depending on your operating system, the file location will vary. The default locations for most systems are:

  • Unix/Linux: /etc/hosts
  • Windows 95/98/ME: c:\windows\hosts
  • Windows 2000/XP: c:\winnt\system32\drivers\etc\hosts
  • Macintosh: [HD]:System Folder:Preferences:Hosts

Background Information
Operating systems typically utilize two methods to make a correlation between IP addresses (e.g., 127.0.0.1) and server names (e.g., "some.machine.com"): host information stored locally -- in a hosts file, and DNS servers. If a matching IP/host record is found locally, a DNS server is not used for lookups. For example, 127.0.0.1 is a reserved address stored in the hosts file which always refers to the local machine (localhost).

By modifying the hosts file, a computer can be 'tricked' into looking for content from a particular server on the local machine. For example, we can assign ads.valueclick.net an IP address of 127.0.0.1. You may now be thinking that this is redundant, since the local machine won't have the content being requested -- this is exactly the point. If the computer can't connect to the target server, it won't be able to load those ads, and you won't see them in your browser.

The end result is that we can manually block sites that distribute ads, pop-ups, track user behaviour, etc., etc. The trick is that the companies delivering this garbage are constantly changing their server names.

For those using Mozilla Firefox, the superb AdBlock extension brings with it new capabilities to perform similar filtering -- the power of pattern matching using regular expressions. Rather than deny access to servers named "ads.server.com" and "ads.server.net" with two hosts file entries, we can literally block (browser) content from all servers with "ads." in the name using a single filter.

Tags: · , , , , , , , , , , , , , , ,

3 comments for this entry ↓

  • 1 rseal // Feb 21, 2004 at 9:01 am

    If I may I would like to suggest, for those who use Micro$oft WinBlows operating systems an additional tool to prevent malware/spyware/creepware/whatever ware...
    SpyBot “Search & Destroy”. This free software has a lot of tools inside to help cleaning and prevent “whateverWare”. It uses a hosts file too, and can clean a lot of garbage on your operating system.
    You may get it here -> http://www.safer-networking.org/.
    Like any other software, read the freaking manual.
    Hugz.

  • 2 Discourse.net // Feb 23, 2004 at 8:44 am

    Blocking Ads In Firefox

    One thing I have not liked about firefox is that it doesn’t play that nice with AdSubtract, the ad-blocking proxy I’ve come to rely on. It works OK with 2.x, but not great under win98se, but really lousy under win xp. And its relationship w...

  • 3 Discourse.net // Feb 23, 2004 at 8:46 am

    Blocking Ads In Firefox

    One thing I have not liked about firefox is that it doesn’t play that nice with AdSubtract, the ad-blocking proxy I’ve come to rely on. It works OK with 2.x, but not great under win98se, and really lousy under win xp. And Firefox’s re...

Leave a Comment

-- Why? This question confirms you are a human user.

  • Advertisments