Pi-hole® - Network-wide Ad Blocking
Basically Pi-hole® is an application that performs the function of being a DNS server and DHCP server if you wish for all the devices on your network. In the process it also aims to block network queries to domains in the categories of analytics, telemetry, advertisements and tracking.
The idea of trying it out had plagued me for a while, with Jeff Atwood, Scott Hanselman and Troy Hunt covering the basic setup on a Raspberry Pi.
But with a router that only serves two devices, my laptop and phone. I can't exactly call my home network sophisticated. So plan B was to use the office network, because the best testers are the ones that don't opt-in.
Although you can use a Raspberry Pi Zero, I felt safer having an actual ethernet port so I went ahead with a Raspberry Pi 3 Model B+ and 16GB microSD card for storage.
Following this great tutorial guide, my Pi-hole was up and running in under an hour.
I used the Raspbian Buster with desktop image without an issue. With the goal being a #BetterInternet I naturally chose Cloudflare as my upstream DNS provider,
184.108.40.206 is the fastest DNS resolver.
If you prefer a GUI like me, you probably prefer TeamViewer for remote access.
Here's a simply guide for setting it up on a Raspberry Pi.
If you can't set the DNS server on your router, then you set the Pi-hole to be your DHCP server to solve this. If you're not using Pi-hole as your DHCP server, you'll see IP addresses in the client column of your query log. If you are using Pi-hole as your DHCP server, you'll see the hostname of the device.
By default your Pi-hole will have the following blocklists.
I've added the following extra lists.
After the Pi-hole is active, you'll notice websites load much faster because of the reduced bloat.
After some time you'll get a sense of the amount of queries going on in your network and the percentage being blocked. Smartphones tend to be the worst offenders with analytics integrated into apps that track every event.
You can also tweak things, it's super simply to whitelist and blacklist domains. Although the Pi-hole will cover most of your bases, for things like YouTube's video ads you'll need to rely on uBlock Origin.
This has been a fun worthwhile project but due to its low resource usage, just using a Raspberry Pi for running Pi-hole makes it very expensive so I recommend finding another secondary project like a YouTube content cache using Squid.