How to Ban Advertising with Bind

  1. 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"; };

  2. create the file dummy-block.zone
    1. find the line where directory is defined in named.conf. It should look something like:
      directory "/var/bind";
    2. cd to this directory
    3. then cd to the subdirectory pri
    4. open a new file "dummy-block.zone" in a text editor
  3. 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
  4. Change the variable "your.domain", to the appropriate string, save the file and exit.
  5. reload the bind's cache by typing "rndc reload"
  6. 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

  7. you are done, and will never have to waist bandwidth on "you have a prize waiting for you" banners again.