Sie sind auf Seite 1von 2

Eradicating doubleclick.net from the planet http://sam.zoy.org/writings/internet/doubleclick.

html

1 of 2 16/04/2011 12:33
Eradicating doubleclick.net from the planet http://sam.zoy.org/writings/internet/doubleclick.html

Eradicating doubleclick.net from the planet


crush, kill, destroy, annihilate, overwhelm, bury
News
January 8th, 2002: mission complete ! (but the war is not over)
November 25th, 2000: page creation

Rationale
Advertising networks like doubleclick.net are evil. They are spammers, they track private
information, and they are a spectacular waste of bandwidth.
This page is my contribution to the crusade against these advertisers the Internet doesn’t
need. I will explain what every self-respecting BOFH can do to spare bandwidth and get
rid of doubleclick.

Technical overview
The best way to get rid of doubleclick is to ignore them.
The first idea would be to firewall their IPs. The problem is that they have numerous
webservers around the world, and that there may add new servers, or change their IPs, or
there may be other websites on their servers. So, the idea is to intercept the
ad.doubleclick.net DNS by configuring your local nameservers, and make it point to
something else. 127.0.0.1 is the first idea, but the problem with this is that it prevents the
image to load at all, and some pages may render very badly. My idea is to replace the
image with a custom one.
The goal of my method is to be set up on a WAN or LAN with public addressing, in a
place where you can’t force users to use a proxy. If you have private addressing, it is likely
you have a proxy and you can use stuff like JunkBuster.

Setting up the DNS servers


We will add a new zone for each DNS name we want to block, because it’ll let us use the
same zone file. Ugly, but effective.
I added the following lines to named.conf on my primary nameserver (feel free to add
new hosts if you find other evil advertisers):
zone "ad.doubleclick.net" { type master; file "pub"; };
zone "ad.fr.doubleclick.net" { type master; file "pub"; };
zone "m.doubleclick.net" { type master; file "pub"; };
zone "pubs.mgn.net" { type master; file "pub"; };
zone "lnads.osdn.com" { type master; file "pub"; };
zone "ads.freshmeat.net" { type master; file "pub"; };
zone "pub.nomade.fr" { type master; file "pub"; };
zone "pub.libertysurf.fr" { type master; file "pub"; };
And this is my custom zone I put in the pub file:
@ IN SOA ns1.mydomain.com. hostmaster.mydomain.com.
( 2000102007 21600 3600 3600000 86400)

IN NS ns1.mydomain.com.
IN NS ns2.mydomain.com.
IN A 62.4.16.186
Replace ns1.mydomain.com and ns2.mydomain.com with your nameservers, and
62.4.16.186 with the IP of the webserver which will serve the requests.
And finally, this is what I put on the secondary nameservers:
zone "ad.doubleclick.net" { type slave; masters { 62.4.16.186; }; };
zone "ad.fr.doubleclick.net" { type slave; masters { 62.4.16.186; }; };
zone "m.doubleclick.net" { type slave; masters { 62.4.16.186; }; };
zone "pubs.mgn.net" { type slave; masters { 62.4.16.186; }; };
zone "lnads.osdn.com" { type slave; masters { 62.4.16.186; }; };
zone "ads.freshmeat.net" { type slave; masters { 62.4.16.186; }; };
zone "pub.nomade.fr" { type slave; masters { 62.4.16.186; }; };
zone "pub.libertysurf.fr" { type slave; masters { 62.4.16.186; }; };
Again, replace 62.4.16.186 with your primary nameserver’s IP address.
All these operations may be easily scripted so that adding a new host becomes trivial. I
leave this as an exercise to the reader.

Setting up the web server


I use several Apache features: mod_rewrite, PHP, and the GD library module for PHP.
This is what I put in httpd.conf (the important stuff is the Rewrite rule and the
ServerAlias):
<VirtualHost ad.doubleclick.net>
ServerAdmin admin
DocumentRoot /opt/www/pub/
<Directory /opt/www/pub/>

2 of 2 16/04/2011 12:33

Das könnte Ihnen auch gefallen