I don’t know about you, but for me, these days, browsing the Internet isn’t the fun and pleasant experience it once was. The influx of adverts is overwhelming and sometimes this makes a simple download fraught with danger – those without antivirus beware!
Of course with care, you can ensure that that “download” link is indeed what it purports to be, but it’s all to easy to click an advert disguised as a download link instead – sometimes you get away with it, ending up at a completely benign, but irritating distraction. Other times you get lost in a myriad of pages of adverts and you just give up.
Well, there is a clever solution to this; Pi-Hole – not the best name, but let’s not worry about that, instead, let’s focus on what it’s built to do –
Network-wide Ad Blocking
A black hole for Internet advertisements
As it’s tagline suggests, Pi-Hole blocks adverts, it’s also open source, which means that the software and code is made freely available. End users can also modify the source code to suit, should they see fit and have the capabilities to do so.
I heard about Pi-Hole via the Raspberry Pi magazine (issue 71 of The MagPi). A magazine centered around the Raspberry Pi range, the flagship of which is the Raspberry Pi 3b. At about £30, there’s a lot to like about this single board computer, it’s also where Pi-Hole originated and gets its name. Since Pi-Hole was created, it’s now available on many platforms and can even be found running on corporate networks, serving thousands of users.
Pi-Hole works by replacing the DNS (Domain Name Server) on your network. The DNS’s job is to resolve domain Names to IP addresses. An example of a domain name is www.google.co.uk – it’s what you type into the browsers address bar to get to the Google homepage. This domain name isn’t able to tell your browser where to download the Google’s homepage from – it’s an alias, just like giving your house a name, but with the exception that domain names have to be unique.
i.e. www.google.com resolves to 220.127.116.11
It’s the IP address (the number behind the alias) that is the real address of the website you’re browsing. Why?, well, the idea of course, is it’s easier to remember www.google.co.uk, than 18.104.22.168.
When you type https://www.techradar.com in your address bar, your browser first asks your DNS to resolve https://www.techradar.com to it’s IP 22.214.171.124.
The browser then downloads the HTML, which in turn has embedded links for it’s images and it’s ads.
With Pi-Hole acting as your DNS the domain name is checked against a block-list. If the domain name is blocked, then Pi-Hole returns a special IP address (it’s own), so that the advert doesn’t appear on your your page.
This is Techradar without any ad blocking in place
The same page with Pi-Hole running as my DNS on my network. Quite a difference, I’m sure you’ll agree.
Now after using the Pi-hole for the best part of a month, I can honestly report that what I considered to be a “test-project” is staying just where it is – it’s installed on a Rpi and is hanging by it’s network wire from my data cabinet! I’ll be recommending that other people use it too.