Pihole on Raspberry PI

Install Pi Hole

At this point, we assume that you have already set up an operating system on your Raspberry Pi. Pi-Hole is installed via the terminal of the respective Raspi Linux. In our example, we perform a remote installation of the system via an SSH connection. Of course, you can also install the Pi-Hole directly on the respective Pi. In both cases, the terminal command for the installation is:


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


The Pi will now start downloading and installing Pi-Hole. Depending on your Pi model and internet connection, this may take a few minutes. Allow the Raspi to do its best work during this time.

The first installation of Pi-Hole runs via the terminal.

Once the download is complete, an automated setup wizard will start. Here you first select the network interface with which the Raspberry Pi goes online. As already described, it is advisable to connect the mini-computer directly to the router via Ethernet.


Then select a DNS provider that Pi-Hole will use to resolve your web requests. If you are not satisfied with the pre-selection, you can use “Custom” to set up your own DNS provider. The Chaos Computer Club, for example, provides a list of DNS providers that protect the privacy of users.

In order for Pi-Hole to be able to forward visited websites, you need to set a public DNS server.

Just like web browser ad blockers, Pi-Hole's ad filtering is based on user-managed filter lists. Pi-Hole comes with a set of default lists that you can usually adopt for good coverage. For consistent advertising blocking, you should also activate filtering for the IPv4 and IPv6 protocols - so accept the default setting here as well.


Pictures to Pihole

Pihole

Pi-Hole's pre-built filter lists are usually a good start for an ad-free network.

In order for Pi-Hole to be reliably available as a DNS server, the Pi must have a fixed IP address. You can do this either via your router or directly in the Pi-Hole setup. Just accept the current IP address at this step by selecting “Yes” to later call Pi-Hole from it.

Pi-Hole's pre-built filter lists are usually a good start for an ad-free network.

In order for Pi-Hole to be reliably available as a DNS server, the Pi must have a fixed IP address. You can do this either via your router or directly in the Pi-Hole setup. Just accept the current IP address at this step by selecting “Yes” to later call Pi-Hole from it.

Be sure to remember your Pi-Hole credentials.

                                                Set up Pi-Hole as a DNS server

After installation, Pi-Hole runs automatically on the Raspberry Pi. So that advertising can now be filtered, you must use the Pi-Hole-Pi as a DNS server. Most routers allow changing the DNS server in the settings. Enter the IPv4 and IPv6 address of the Raspberry Pi as the DNS server. All devices connected to the router then surf ad-free.


Alternatively, you can manually set Pi-Hole as the DNS server for each device. The way to get there depends on the respective operating system. In Windows 10, for example, you can find the settings by searching for "network status" and selecting "change adapter options" in the Windows start menu. Here, right-click on the network connection used, select "Properties" and double-click to change the settings for "Internet Protocol, Version 4" and "Version 6" to the Pi addresses. On an iPhone, the corresponding options can be found in the WLAN settings. Tap on the appropriate connection, select "Configure DNS" and enter the appropriate IP addresses.

                                                   Pi-Hole: Adjust configuration

Once the traffic goes through the Pi-Hole, you should no longer see any online ads. Nevertheless, it can be worthwhile to adjust the configuration of the server. To do this, either enter the Pi-Hole IP followed by "/admin" in the URL bar (e.g. 192.168.1.55/admin) or call up the page via "http://pi-hole/admin". Log in here with the password you wrote down. You can now use the menu on the left to deactivate the Pi-Hole blocker, for example with "Disable". In the "Settings" area you will find not only various setting options but also the IP addresses of Pi-Hole, which you can then easily copy.

The Pi-Hole admin page allows you to set a number of settings and view statistics.

If you would like to deactivate filtering for certain pages, for example to support good online content by accepting advertising, you can do this in the "Whitelist" area. Simply enter the domain here, for example "heise.de" and click on "Add". In the "Blocklist" area, you can configure additional blocklists that you can find in various online forums.