Introduction

So it’s a 🥧 that blocks ads, how is that different from an add-on like uBlock Origin? An ad-blocker like uBlock only works on the device’s browser where it’s installed, like when you browse the web, not on your actual OS. Well when we set-up a pi-hole we can force all the devices on a network to block content independent of what type of hardware or software it is. This means that ads can be blocked on your fancy smart TV, gaming console and smartphone, cool right?!

  • pi-hole website
  • pi-hole GitHub
  • Follow this tutorial if you want a more in-depth pi-hole setup on a raspberry pi

DNS Sinkholes

What’s a DNS you might ask? Well I’ve covered it a bit more here but what a DNS does is it converts the domain-names to ip-addresses and back. So instead of having to remember: 151.101.1.140, we can type in reddit.com and get the website served.

The pi-hole is a type of DNS sinkhole. Sinkholes work by filtering out the type of DNS traffic based on a blocklist file containing URLs that we want to block or redirect the user from visiting.


Raspberry Pi

A pi-hole is usually (as the name suggests) set up on a Raspberry Pi. It’s a very small computer. One can also setup a pi-hole on any type of computer, virtual machine, or even on a container service, like a docker container.

Image source


General Pi-hole Setup

This following setup is very general and it doesn’t go into detail what to do, follow the link in the intro for more in-depth setup steps.

However, Let’s say we have a raspberry pi laying around, we can use it to create a local pi-hole:

  1. Install a compatible raspberry pi OS like: Raspbian.
  2. Install the pi-hole software either manually or via their automatic installer.
  3. Set your router or local DHCP to force each device and client on the network to use the pi-hole as their primary DNS server.
    • One can also add manually add the pi-hole as the DNS server of choice for each device.
  4. Navigate to your raspberry pi’s IP address, followed by /admin to get to the web-interface. It can be used to view statistics, change settings, and everything you can imagine.

Yey you now have a freshly installed pi-hole! 🥧

Image source


Pros

Well its always nice to block ads, and trackers. With those blocked you’re less likely to click on those pesky pop-up ads filled with malware on your third-party Robolox clone app. It can also reduce your bills if you are paying by the amount of data you are using. Blocking trackers and ads on smart TVs, and other more “closed-circuit” systems, that are still connected to the internet, is also a nice thing to have. Having all the customizability in the world is also nice, and the maintenance is zero to none if you want it to be so, but who want that!?

The availability of network wide blocking and filtering can aid in blocking certain websites and content if you want to play Chinese firewall, or use some sort of parental control.


Cons

As stated above there is a small amount of configuration and management that needs to be done to keep both the pi-hole, its block-, and allowlists, and its underlying OS up-to-date, but nothing that will make you go crazy and not even a network engineer. Yes parental control and content blocking can also be seen as a bad thing, and that why I have it here as well.


Tips

You can install and configure a VPN like Tailscale, WireGuard or OpenVPN to make your pi-hole sinkhole DNS accessible outside your home network.

There are other services like: NextDNS that also handles DNS filtering, as well as working as a encrypted DNS provider (which a default pi-hole setup does not do). I might do a post about it in the future.

Here is my own (outdated as of 12.02.2024, might update soon…) pi-hole blocklist where you can see what pi-hole blocklists look like.


Conclusion

There is a grey area when it comes to not loading ads, indiscriminate ad-blocking can inadvertently harm content creators and media outlets dependent on ad revenue. This ethical conundrum underscores the importance of mindful filtering choices. On the other hand, Pi-hole offers a balanced solution: while it empowers users to extensively block unwanted ads, it equally enables them to consciously whitelist URLs and filters. This allows the user to both block ads and trackers, whilst supporting their favorite content creators.

The communities of both the pi-hole, and raspberry pi projects are both friendly, helpful, and nice to chat with. They will help with any questions, so don’t hesitate to open a discursion with them:

Image source