This page looks best with JavaScript enabled

Blocking Ads

 ·  ☕ 2 min read

Background

Blocking ads is not entirely about blocking the annoying aspect of web banners, ads are often used to track a user across a site or set of sites. Ads have also been linked to malware injection attacks.

Ad lists are services that provide a list of known ad servers. This list can then be used to block the ad server. Ad lists are not perfect as its not difficult for an ad server to change their domain name and no matter what list you use, it can never be complete (new ad servers show up ever second); however, they are better than trying to keep track of ad servers yourself.

Ad List Providers:

Details

To block ads at the machine level you can add the ad server list obtained from one of the above ad list providers to your host file (this is the hard way as it is a large list and makes your host file large) or you can use dnsmasq.

To block ads at the LAN level you need to add the list to your LAN DNS server or proxy server. The following article shows how to add it to a DD-WRT router.

There are benefits and drawbacks to implementing ad blocking on the machine or the LAN.

Machine blocking:

  • benefit: always available (if you have a laptop and take it to work, your LAN based blocking wont help you)
  • drawback: you have to implement the solution on all machines and ensure it is kept up to date everywhere
  • drawback: additional software/processing on your local machine

LAN blocking:

  • benefit: easy to manage for all computers (this covers your entire network in one place)
  • benefit: does not require installing additional services on each local computer (no added overhead of a local dnsmasq instance)
  • drawback: requires a router/proxy with dnsmasq

Notes

Test your ad block solution with: nslookup {server-url} (for example: nslookup doubleclick.net). This should return something similar to:

nslookup doubleclick.net
Server:         192.168.1.1
Address:        192.168.1.1#53

Which indicates any request to doubleclick.net is resolving to 192.168.1.1 (this is my local network).

If you have other ad server providers you recommend please feel free to contact us.

Share on

drad
WRITTEN BY
drad
Sr. Consultant