How to Ban Advertising with Bind
- First add the names of the most annoying advertisers to named.conf, in the following format:
zone "adimages.go.com" { type master; file "pri/dummy-block.zone"; };
zone "admonitor.net" { type master; file "pri/dummy-block.zone"; };
zone "ads.specificpop.com" { type master; file "pri/dummy-block.zone"; };
zone "ads.web.aol.com" { type master; file "pri/dummy-block.zone"; };
zone "ads.x10.com" { type master; file "pri/dummy-block.zone"; };
zone "advertising.com" { type master; file "pri/dummy-block.zone"; };
zone "amazingmedia.com" { type master; file "pri/dummy-block.zone"; };
zone "clickagents.com" { type master; file "pri/dummy-block.zone"; };
zone "commission-junction.com" { type master; file "pri/dummy-block.zone"; };
zone "doubleclick.net" { type master; file "pri/dummy-block.zone"; };
zone "go2net.com" { type master; file "pri/dummy-block.zone"; };
zone "infospace.com" { type master; file "pri/dummy-block.zone"; };
zone "kcookie.netscape.com" { type master; file "pri/dummy-block.zone"; };
zone "linksynergy.com" { type master; file "pri/dummy-block.zone"; };
zone "msads.net" { type master; file "pri/dummy-block.zone"; };
zone "qksrv.net" { type master; file "pri/dummy-block.zone"; };
zone "yimg.com" { type master; file "pri/dummy-block.zone"; };
zone "zedo.com" { type master; file "pri/dummy-block.zone"; };
- create the file dummy-block.zone
- find the line where directory is defined in named.conf. It should look something like:
directory "/var/bind";
- cd to this directory
- then cd to the subdirectory pri
- open a new file "dummy-block.zone" in a text editor
- add the following contents to the dummy-block.zone, so that all of the advertiser's names are mapped to 127.0.0.1:
$TTL 24h
@ IN SOA server.your.domain. hostmaster.your.domain. (
2003052800 86400 300 604800 3600 )
@ IN NS server.your.domain.
@ IN A 127.0.0.1
* IN A 127.0.0.1
- Change the variable "your.domain", to the appropriate string, save the file and exit.
- reload the bind's cache by typing "rndc reload"
- test the new name server with nslookup. For example, "nslookup nsads.net". You should see output like:
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: msads.net
Address: 127.0.0.1
- you are done, and will never have to waist bandwidth on "you have a prize waiting for you" banners again.