Now that I had finished building my PiDP-8 I needed something for the Raspberry Pi B+ in it to do other than just flash the blinkenlights. I can’t remember how I first heard about it, but for the past two weeks I’ve been running a DNS-based ad-blocker utility called Pi-Hole.
Pi-Hole requires a few basic packages, like lighttpd and dnsmasq, but following the manual installation instructions was relatively easy. At a high level, Pi-Hole turns your Raspberry Pi into a local DNS server for your network. You configured your devices (or router) to use the Pi-Hole as the primary DNS server for handling DNS lookup requests. By using a script (named gravity/sh, continuing the black hole theme), Pi-Hole downloads several common blacklists containing the web addresses of 65k known ad-serving domains and redirects them to the Raspberry Pi. So, when a browser on your PC visits a site, which in turn tries to pull an ad from some.ad-server.net, the DNS on the Pi-Hole redirects that request to lighttpd on the Raspberry Pi and no ad is loaded. This method has a noticeable impact on the speed of loading web pages since, unlike using an ad-blocking plug-in in your browser, the ad request never actually leaves your network.
Initially, Pi-Hole included a blacklist called mahakala which made the total number of blocked domains over 1.6 million, but included a lot of legitimate domains, like xkcd.com and microsoft.com. That blacklist has since been commented out, but I haven’t really noticed a difference only blocking 65k domains. Pi-Hole does have a whitelisting facility, but it doesn’t use wildcards so you have to include each individual domain you want to allow through the DNS black hole.
Pi-Hole includes a basic web console, which currently just shows statistics, but promises more admin-type features in the future.