Pi-hole® Guide – Setting up Pi-hole for First Use

Internet advertisement can be troublesome sometime, especially, if you’re a non-techie person and tend to use free alternatives such as adblockers designed for browsers to block advertisement for you. Internet advertisement also allows content-creators or bloggers to earn some revenue to support their development to provide a better content for you. However, these come with a few risks where, the credibility of the developer who developed the adblockers is still questionable. There are a few adblockers participate in an acceptable ads program by allowing a few ads to pass through as the developer of the program has to earn some money to support their development. Enthusiastic developer focused more on providing a safer program designed to not only block the advertisement but, also to reduce the amount of tracking from the spying eyes.

Pi-hole® Guide - Figure 1: Introduction to Pi-hole
Figure 1: Pi-hole Guide – Introduction

What if I tell you, you can setup your own internet advertisement black-hole for less than RM 400 (est. ≤ $100) with you being the sole person to manage, and protect your home device from being targeted by the advertisers out there? This is where, the Pi-hole comes in. In general, a Pi-hole is a DNS sinkhole that filters advertisement without requiring to install any client-side software. This method is way different compared to setting up Diversion on ASUS router that receives RMerlin‘s touch.

Of course, there are a few prerequisites has to be considered. The minimum requirement of installing Pi-hole of having a minimum of 52MB of free space in your SD card and 512MB of RAM. The Pi-hole further can be installed under any of these following operating system:

RaspbianStretch / BusterARM
Ubuntu16.x / 18.xARM / x86_64
Debian9 / 10ARM / x86_64 / i386
Fedora31 / 32ARM / x86_64
CentOS7 / 8x86_64
Table 1: Supported Operating Systems

If you’re an expert in computer, you can also run the Pi-hole in a container or deploy the Pi-hole to a supported operating system (refer to Table 1) via the provided automated installer by the developer. Each successful purchase of Raspberry Pi comes with pre-installed system image or an OS image that you can select, similar to how you install a standard Windows operating system just by selecting the version you need.

Pi-hole® Guide - Raspberry Pi Hardware Model.
Figure 2: Pi-hole Guide – Raspberry Pi 4B Rev 1.2

The Raspberry Pi unit that I have with me is the 4GB version that comes with a complete set before assembled by me for first use. I will be sharing the steps required in order to get the Pi-hole online below. But, before that, there are a few simple keys you should know before proceeding. I’ve listed three-required keys to ease the installation process for the better understanding, especially for novice users since you have to use only keyboard to do so.

  • Enter = OK / Cancel (if the option given)
  • Arrow key = Hover through the options
  • Spacebar = Select / Deselect

We are ready. Let’s dive into the process of setting up Pi-hole.

Pi-hole® Guide - Step 1: Key in the following script.
Figure 3: Pi-hole Guide – Installing Pi-hole on Raspberry Pi machine

In your terminal window, key in, “curl -sSL https://install.pi-hole.net | bash” command. The installation process will begin once the system acknowledges the command. This is the easiest and quickest way of installing Pi-hole. Alternatively, there is another way of doing so by cloning the repository and run it.

Pi-hole® Guide - Step 2 - Pi-hole automated installer
Figure 3A: Pi-hole Guide – Automated Installer reminder

A message will be shown by the installer inside the terminal to let you know that the installing process will take place once you pressing on the ‘enter’ button.

Pi-hole® Guide - Step 3 - Donation notice
Figure 5: Pi-hole Guide – A short donation notice.

You can opt to donate for the development of the project at the given link to show the appreciation towards the developer that provide us a solution that is very useful especially to protect ourself from trackers and advertisers.

Pi-hole® Guide - Step 4: Assigning a static IP
Figure 6: Pi-hole Guide – Assigning a static IP.

The next procedure requires a static IP. This means that, you can set your preferred IP or you opt for the pi-hole to automatically assign IP for itself.

Pi-hole® Guide - Step 5: Picking a DNS provider
Figure 7: Pi-hole Guide – Selecting DNS Provider

You can use the arrow key on your keyboard to pick your own preferred DNS provider. I’ve personally picked Cloudflare as my preferred DNS provider. Another advantage of picking a right DNS provider is the pi-hole allows you to set your own custom DNS provider address.

Pi-hole® Guide - Step 6: Selective third-party blocking list
Figure 8: Pi-hole Guide – Third-party blocking list

Pi-hole also allows you to pick if you want to use any of these third-party blocking list and I would strongly suggest to select everything for better ad-blocking performance.

Pi-hole® Guide - Step 7: Picking Blocking ads over Internet protocol
Figure 9: Pi-hole Guide – Internet Protocols Ad Block

In this part, you can select to block advertisement over IPv4 or IPv6. I pick on both since I am using IPv6 as well.

Pi-hole® Guide - Step 8: IP conflict notice
Figure 10: Pi-hole Guide – IP conflict notice

Ignore this message and proceed to the next process. It is just a friendly reminder, if in the future, if your router accidentally assigns another IP address for the Raspberry Pi or you accidentally factory set your router, you still have to manually assign the IP picked/provided automatically by your router in the Figure 5, above.

Pi-hole® Guide - Step 9: Selecting web admin interface
Figure 11: Pi-hole Guide – Web admin interface selection

It is advisable to leave the web admin interface option as on. If you’re professional network administrator, you can turn off the admin interface by picking off option. But, to be on the safer side, leave the option as on.

Pi-hole® Guide - Step 10: Web server installation
Figure 12: Pi-hole Guide – Web server installation

After enabling the web admin interface in Figure 10, it is recommended to leave the option as on to install the web server which will be used by you to access the dashboard of the pi-hole, later.

Pi-hole® Guide - Step 11: Enable the logging query
Figure 13: Pi-hole Guide – Enabling logging query

The system will ask you to either keep logging the traffic (requests made by your device to access to a site) or turn it off. This option can leave it as on. If your only intention to block the ads, you can turn this feature off. This feature later can be turned on, over the dashboard.

Pi-hole® Guide - Step 12: Pi-Hole Privacy mode
Figure 14: Pi-hole Guide – Pi-hole Privacy Mode

If you enabled the logging query previously, this is the option to allow you to select the privacy mode via the given options. I personally would like to analyze and record the sites visited by the connected clients in my network for the purpose of troubleshooting and protection against accessing to unwanted sites.

  • Pi-hole® Guide - Step 13: Installation Process 1
  • Pi-hole® Guide - Step 13: Installation Process 2

Once picking your preferred privacy mode has completed, the system will proceed to install the settings required by default to allow the pi-hole to perform as router-level-adblocker. This will consume a few minutes.

Pi-hole® Guide - Step 14: Successful installation
Figure 17: Pi-hole Guide – Successful Installation

After a few minutes, the system will show that the configuration has been made and you’re ready to access to the internet. Do note that, you have to use the static IP assigned to the Raspberry Pi in the Figure 5 as the DNS server in your router or if your router does not support responding to the configured DNS server, you can turn off the DHCP server in your router and opt to use Pi-hole’s DHCP server. The only difference between those two is, allowing the Pi-hole handles all the DHCP IP allocations allows a more detailed traffic activity of the device in your home network. Also, the password required to login to web admin interface given as well. You will be needing to enter the static IP of the Raspberry Pi, i.e. 192.168.0.xxx or 192.168.1.xxx. You also can view the interface simply by keying in “http://pi.hole/admin“. You can set this either in your wireless router or individually in each client device.

Pi-hole® Guide - Admin Interface dashboard of Pi-hole
Figure 18: Pi-hole Guide – Admin Interface dashboard of Pi-hole

It is recommended to always update by keying in, “pihole -up” command in the terminal once in a week just to make sure the system runs on the latest revision. Do note that, you’re still required to use reputable adblockers such as UBlock Origin and Privacy Badger for extra protection. Another friendly request is to allow your favorite bloggers to earn some revenue by whitelisting their sites to allow the ads to pass through. Raspberry Pi 4 is available in major e-stores like Lazada and Shopee. I would suggest to buy with a set instead of buying parts by parts.

Source: Pi-hole Documentation.

Categories: Guides

Tags: , , , , ,

Leave a Reply

%d bloggers like this: