Remove ads and trackers: Optimize surfing with Pi-hole

Remove ads and trackers with Pi-hole and Raspberry Pi.
Photo: David Bartus, Pexels.

Familiar with those page polluting ads on a website? Where the ad seems more important than the entertainment. Fortunately, when you're done with all those ads, the solution is at your fingertips. It can be solved easily with a mini computer; the Raspberry Pi with Pi-hole installed. The system to be installed, simultaneously block website ads and keep out website trackers that might invade your privacy. 

This section has a number of subsections: Raspberry Pi, SSH and the Pi-hole dashboard.

Raspberry Pi

The first section includes, installing the Raspberry Pi mini computer. This installation and configuration is already described on the website, and can be found as the first bits of the article: Block ads, trackers with AdGuard and Raspberry Pi

After installing the mini computer, continue from this article. It is relatively easy to connect Pi-hole to the Pi.

Pi-hole Installation

  • Relogin into the SSH console and start the Pi-hole installation.
    wget -O basic-install.sh https://install.pi-hole.net && sudo bash basic-install.sh

  • We won't change settings at the first step. The static IP address to function properly, requested by Pi-hole should be configured through the router. All static addresses are then managed by and from one -system. For the overview and manageability.       

  • Choose as an interface, the Raspberry Pi network adapter.
  • Select the Upstream DNS provider. To use your own, select Custom
    The example is using DNS.watch
  • Select Yes to include de block and track list of Steven Black.
  • Install the Admin Web Interface
  • Install Lightttpd and PHP.
  • Select enable query logging

    Choose query logging level 0 in the beginning, since everything is logged and this gives a lot of information how the program works. Over time this can be scaled down. After all, you then know how the program works. Too many logs can negatively affect system performance. 

Pi-hole administrator dashboard

Surft to http://yourip/admin and navigate to the Adlist group management and add aditional blocklist if desired. Well-known commonly used blocklists are:

Blocking trackers and ads with Pi-hole may cause some confusion by your users. For example, if a legitimate website is blocked by mistake. Just using the one and only blocklist installed as default by Pi-hole: Steve Black's unified hosts does significantly change the perceived user browsing experience. Keep in mind that not every user perceives it as positive or optimization when clicking on a Bing ad results in an error name not resolved or a website semi-forces you to disable the adblocker. Otherwise, access will be denied. 

So it is important to take into account the users who are suddenly faced with Pi-hole. Therefore, define exceptions in the management interface if necessary. In the search log, there is a whitelist button for blocked requests. In the case of Bing ads, this immediately leads to a counterproductive aftermath of further listings, which would also pave the way for other online advertising platforms.