In technical terms, Pi-Hole is an ad-blocking DNS server. In plain English, Pi-Hole is a network-wide ad blocker, a black hole for internet advertisements.
I suspect many of you will be running some form of ad-blocking on your devices. It probably takes the form of a browser plugin or mobile app that stops your browser from displaying internet advertisements. And that's fine. It does the job. However, by the time the plugin does its job, the ad has already used up network and device resources. I'd prefer to stop them at the gate, before they even traverse my network. Enter Pi-Hole!
A Pi-Hole can be of use to both business and home users. All you need is a machine capable of running the software.
So what do you need to run a Pi-Hole? Well, not surprisingly, as the name suggests, it is designed to run on a Raspberry Pi. However you can run it on pretty much any computer that can run Linux. I run my Pi-Hole on a virtual machine using 1 CPU core and 1gb of RAM running on a Synology NAS. If you're a fan of Docker, have a read of the article from ServiceMax that I included in the Additional Resources section at the bottom. He goes into great detail on the best way to get a Docker container to run Pi-Hole.
For the most part, you shouldn't need to do anything special to get Pi-Hole up and running, but in case you strike any blockages, have a read of the prerequisites
Once you have a machine ready to be used, installing Pi-Hole is really simple. It's a single command: -
curl -sSL https://install.pi-hole.net | bash
You'll be prompted to answer some fairly simple, plain English questions. We recommend the following during installation: -
- When prompted about a Static IP Address, select No and assign your own static IP address
- You'll then be prompted about your gateway. You can usually accept the default as this will be your router's IP Address
Once you've answered the questions, the installation will run through and install everything you need. This shouldn't take more than 10 minutes.
Once it is up and running, all you need to do to get it working within your network is configure all your devices to use it as the primary DNS server. The easiest way to handle this is to jump into your routers web interface (assuming that you currently use your router as your DHCP server) and edit the primary DNS server to point to your Pi-Hole's IP Address. This will assign the Pi-Hole as the primary DNS server to all devices that are present on your network. In order to get it to work, you will need to restart each device so they get the new DNS settings assigned to them.
And that should be it. Everything should be up and running and you should start to see the effects straight away.
I haven't benchmarked anything on my network, but looking at some websites that I know are infested with ads, like the Australian news websites, the impact is immediately noticeable. If you want to check out some benchmarking, have a read of the article I have included in the Additional Resources section from Troy Hunt (he runs the Have I Been Pwned website). He looks at the impact on those Australian news websites and it is quite staggering.
But let's not stop there. A basic installation blocks a good amount of ads. One of the features Pi-Hole offers is the ability to include curated ad-blocking lists. There is a long discussion here about the best Black and White lists to use. Be warned, these can really ramp up the ad-blocking but they can also have the undesired effect of blocking perfectly safe and useful sites. Use them with caution and I'd suggest that you apply one at a time and assess the impact. We have no recommendations with adding lists to your Pi-Hole - you're on your own!
One thing I did find useful was to create a custom block page for when a website is blocked entirely by your Pi-Hole. There are some very simple instructions provided here about how to do that. I have modified my page a bit, but the final outcome is clear and self-explanatory: -
We have included some articles in the Additional Resources section below that we think are worthy of reading if you are going to introduce a Pi-Hole into your network. And the video at the bottom gives you a very quick run down of exactly what Pi-Hole is.
While Pi-Hole is open-source and provided as a free resource, the developers always appreciate some assistance. They have costs associated with hosting the website and running the associated resources. If you use Pi-Hole, why not head over to their donations page and send a couple of dollars their way.
As always, if you have any questions about Pi-Hole, click one of the contact buttons below this article and get in touch.
There are a huge volume of articles and posts that discuss Pi-Hole, it's uses and some of the traps with installing and using it. Here are a few I think are worth reading: -
- Troy Hunt - https://www.troyhunt.com/mmm-pi-hole
- ServiceMax - https://servicemax.com.au/tips/pi-hole-in-docker-on-synology-the-best-way
- opensource.com - https://opensource.com/article/18/2/block-ads-raspberry-pi