Blocking Ads with dnsmasq

For a while I have an OpenWRT router installed, running a Linux to which I have full root access. One of the services on this devices is a DNS resolver. I use this to block all ads that websites try to sneak into my view.

To accomplish this I combine block lists from multiple sources and configure the resolver to redirect them into a black hole. The configuration for dnsmasq is generated with the following Makefile.

You can execute it as follows: make SERVER= BLACKHOLE=, if all requests should be redirected to and your router is reachable at

(based on PiHole).

To improve the performance, you can choose to download multiple files in parallel by specifying another parameter -j, use -j4 to run four tasks in parallel.

I hope this helps some people to make the web a faster place!