Pi-hole

June 11, 2019    Tags: raspberrypi  unix  pi  debian  tracker  advertisement  pi-hole

None

Online advertisment is everywhere. I don't like webpages where everywhere something pops up or overlays content or you can't really see any content because of the advertisment. On my browsers I like using plugins like AdBlock, uBlock Origin and NoScript. But what can I do on my smartphone inside the Apps or on my Smart-TV?

For sure, I also have Google AdSense enabled on my blog but just because of everybody does it and not for gaining money.

But back to the topic itself. How can we achieve no or less advertisement on a mobilephone or a Smart-TV? I've found a nice project called Pi-hole.

This project is developed by Jacob Salmela since 2015. It is a combination of dnsmasq and a lighttpd webserver. The source code can be found on GitHub.

Pi-hole is a network solution to block advertisement and tracker.

Installation

The installation can be done almost automatic:

curl -sSL https://install.pi-hole.net | bash

After the requirements are installed, it opens the configuration. It is straight forward and you can choose whatever you prefer.

After the configuration is done you get the address for the Web-Interface and the Login-Password:

http://pi.hole/admin
# or
http://IP/admin

Setup as a DNS-Server

Now the service itself is up and running. Now we have to configure it as a dns service to all hosts in the network.

do it manual

If there are not too many hosts you can add the new dns everywhere by hand

dhcp

If you are using dhcp in your local network to get an IP to new connected hosts you can add your dns there. I'm using a FritzBox and that was the easiest and fastes way to get the new dns on all hosts.

router

On some router you can configure the dns directly in the managment interface. Pro: For a client nothing changes. They request their dns still to the router. Con: On my FritzBox it is not working, because of the included DNS-Rebind Protection.

Update pi-hole

At the moment Pi-hole can not be updated from the Web interface because it requires a server restart. The restart would interrupt the update itself. Therefore it needs to be updated from the command line:

pihole -up