PiHole

What is a PiHole?

The PiHole is an amazing piece of free software which can run on literally any device. Well, desktop device. I am sure you could get it to run on android phones with Termux or something though. However, the PiHole is named after the Single Board Computer (SBC) line called the Raspberry Pi which is the device it was intended to run on.

This is because the Raspberry Pi (RPi for short) is ridiculously low-power for the punch that it packs. And even then, the PiHole does not even need that much processing power and can instead run on the lowest spec board in the line - the RPi Zero. This means no need to leave a whole desktop PC idling around 24/7 which is a rather big "ouch" on your electricity bill!

The Raspberry Pi

On the right is the RPi board I am using. It's a rather recent RPi 3b Rev1.2 with 1 GB of RAM and a quad-core 64bit 1.2 GHz processor.

This is total overkill for the PiHole but I intend on having more server software being hosted on this in the future. Regardless, it's not like I could get my hands on the low end RPi Zero in this silicon shortage epidemic. And with the scalpers too... I'm poor enough like this already.

The benefit of this board is the Ethernet port which lets me connect the Pi anywhere in my house without suffering the reduced speeds caused by WiFi.

The Purpose of having PiHole

Well, what does PiHole do? A lot, actually. It acts as an intermediary between your home (local) network and the outside world and can block outbound queries.

But why on Earth would you want to do that? Simple. PiHole is an effective adblocker. It blocks the ads and trackers at the source and the requests for those never leave your network. It also saves bandwidth since you do not download the ads or trackers locally before having them blocked by your browser's adblocker.

To better understand, it's necessary to know how your network works!

How Your Network Works... For dummies!

Network protocols are tremendously complicated and boring to the average person. So I'll keep it simple!

Your network works by requests, essentially. When you want to go to, for example, YouTube, you will type youtube.com in your browser or search engine. However, the internet is just a giant network - like a spider web. To get YouTube displayed in your browser, the webserver at YT headquarters needs to send you the webpage - the combination of HTML, JS and whatever else is needed for your website. Before the webserver sends you the webpage data, you need to request it from them.

So, when you type in youtube.com, it needs to be converted to an address which can be recognised on the internet. This is in the form of an IP address which is a series of digits like this 172.217.170.206 (that's the one of Google!). But since that jumble of numbers is not particularly human-friendly, we stick to fancy URLs. But, if you type that IP into your browser, it will get you to the same place.

Your DNS - Domain Name Server - deals with converting your URL into an IP address which is friendlier to the entire network. For everyone here in Mauritius, you will probably be using MyT's own DNS. Or whatever DNS they make you use.

No Ads! (speedtest is a website usually plagued with ads)

Amazon Ad System Being Blocked. Farewell ads and trackers!

Advertisements and How They're Blocked

Advertisements are awful. YouTube videos, news articles, everywhere! While I do agree that those websites need the revenue, we have sadly reached a point where advertisements are a pervasive part of our online experience. This is where the PiHole come into play. Normal adblockers simply prevent the ads from being displayed in your browser, by hiding some parts of the HTML code. What these in-browser adblockers do not do, on the other hand, is prevent the ads from being downloaded to your machine.

The issue with that is primarily bandwidth and the act of downloading ads means more of your internet is being used on multimedia and the websites load slower.

PiHole blocks the ads at the source. You see, ads are usually managed by a select few companies. Such as Google's AdSense. This allows interchangeability of ads since they are not hard-coded into the website but fetched separately. This means, when you request a website, you get 2 kinds of queries being sent out of your home network. One for the content of the website and one for the ads.

PiHole prevents the latter from even leaving your network, effectively preventing the website or application from receiving the advertisements. The ads are never downloaded (instead of just being blocked from displaying), saving bandwidth and speeding up website loading.

MyT Making Your Life Hard

In order to block the ads, PiHole needs to act like your DNS server. That's how it can intercept and block the requests which are destined for the ads server. The requests which are genuine are forwarded to an actual DNS server of your choosing (OpenDNS, Google DNS etc...). Now, since you basically want the PiHole to be covering your devices on your network, it would be ideal to set a network-wide setting to direct all DNS queries to the PiHole.

But MyT does not let you change your DNS or DHCP servers on their router! So you are forced to use the DNS they provide. And, sure this is speculation, but I seriously think it's to make it easier to profile you and your online activities since all the websites you visit will involve queries going to MyT's own DNS or one they designated.

As such, I ended up simply changing the DNS in the network settings of all my home devices. For the moment, I do not know a workaround for MyT's restrictions, unless you have a separate home network layered one tier below the MyT, which is something I will be doing eventually.

Part of the PiHole dashboard. You get to view the number of queries, as well as those blocked.

Without PiHole

With PiHole