Mahdi Malkawi's Website

Project: Pi-Hole

Pi-hole is a Linux network-level advertisement and Internet tracker blocking application which acts as a DNS sinkhole and optionally a DHCP server intended for use on a private network. It is designed for low-power embedded devices with network capability, such as the Raspberry Pi, but supports most Linux distributions and Docker containers.

Pi-Hole also comes with an informative web interface to track and manage queries on the network.

I have decided to go on with this project, as it improves network performance since advertisements are blocked before they are downloaded by intercepting the DNS request that attempts to connect to obtain IP addresses of advertisement and telemetry servers.

I have noticed on my network that they are usually over 30 different trackers and adverts built into a typical webpage. This information has been derived from my statistical data from my adblocker on the browser level (Adguard). Also, on commonly visited websites such as Reddit and YouTube, there is an abundance of adverts that worsen the experience and reduce network performance.

What Pi-Hole does, is that it stands in between the device and the DNS request. If a request for a blocklisted site comes through, it will stop the request and respond with an unspecified address telling the device that the ad server does not exist. This is referred to as a DNS sinkhole.

Some advertisements cannot be blocked using this service as some embedded adverts that Facebook and other social media sites implement are embedded into the webpage that the content is on. This applies to a few websites, meaning this software is still highly effective.

Another reason that I utilise Pi-Hole is that it allows complete management through a web interface. This allows modifications remotely by logging in with the framework of: IP ADDRESS/admin.

Entering the correct details required for installation.

Other changes that have occurred due to the installation of Pi-Hole is that lower-end devices connected to my network are significantly more responsive because advertisements are blocked before they are loaded in.

Pi-Hole currently blocks 45.6% of DNS requests.

Overall, Pi-Hole has increased the responsiveness of my network and ensured that most advertisements are removed from web pages at the DNS level.

Finally, another perk I found out about using Pi-Hole, is that Pi-Hole shows the status of the Raspberry Pi, such as the Temperature, CPU load and memory consumption. These are generally essential metrics that I usually check for using the bash commands:

mahdimalkawi@Xubuntu:~$ vcgenmd measure_temp
35.6C

This bash command above shows the temperature of the CPU for my Raspberry Pi 4. However, this command has drawbacks, which are that I would have to manually enter this command every time I would like to check the metric. Now with Pi-Hole, I have access to this metric and more 24/7, and I also can view this metric on all the devices that are connected to my network without unnecessarily typing bash commands.

I encountered a few problems using Pi-Hole, such as installing new ad list definitions. I noticed that once I added a new list to Pi-Hole, it was not implemented onto my network. I overcame this problem whilst going through the settings of the Pi-Hole on the web interface, where I stumbled upon a setting that is located under Tools > Update Gravity.

Gravity is a list that is constructed by combining all ad lists that have been added. The reason that I found that new definitions were not being implemented onto my network was that I did not update Gravity. I understood this to be the issue, as Gravity is the centralised ad list that contains all the other ad lists. For the ad list to be applied to my network, it would have to first go to Gravity. Once Gravity was updated, I saw that my Domains on the blocklist grew from 150,000 to 7,631,269.

Once the original problem of my ad lists was solved, I encountered another problem related to implementing the new ad lists. This is because all the devices that were connected to my network could not see YouTube thumbnails. I pinpointed the problem to the new ad-list definitions as this did not occur with the base definitions that the Pi-Hole came with.

To solve this problem, I disabled ad lists that contained definitions for YouTube. Once I refreshed the webpage, and I saw that the YouTube thumbnails were being loaded, I deleted the conflicting ad list. This resolved the problem. As of typing this 5th January 2023, no other issues have been encountered.