Intsalling Pi-Hole on Raspberry Pi
In this guide, I will guide you through how to set up Pi-Hole for your network. Because Pi-Hole is very resource efficient, it can run on any version of Raspberry Pi. You can even run it over Wi-Fi on a Raspberry Pi Zero!
Prerequisites
- Raspberry Pi with Raspberry Pi OS Lite
- Basic knowledge of your home network setup, such as finding the router login information in order to set the DHCP setting
- Alternatively, if you do not know your router information, you can set the DNS setting on your local computer instead to take advantage of Pi-Hole
Step 1: Find the Pi’s IP Address
Login to your Pi locally or via SSH. Use the ifconfig command to find out your Pi’s IP address. You will need this information later.
ifconfig
The IP address is listed next to the inet, on the second line.
Step 2: Install Pi-Hole
The developers at Pi-Hole project have a simple one line install script for installing Pi-Hole. Enter the following command to start the installation process:
sudo curl -sSL https://install.pi-hole.net | bash
Follow through the steps to continue with the installation.
For the upstream DNS provider, you can set this to any DNS provider you want. I personally use Cloudflare DNS 1.1.1.1 and 1.0.0.1 as Cloudflare DNS are known to be more privacy focus than the other DNS providers.
Pi-Hole comes with one default block list now days, so keep it and continue on.
I usually keep both IPv4 and IPv6 on. You can deselect the IPv6 option if you do not run an IPv6 network.
Step 3: Configure Pi-Hole
When Pi-Hole completes installation, it will have a random password set for you to login into the web console. You can change the password by issuing the following command:
sudo pihole -a -p
Click Login to the web console.
There are many things you can do once logged in. Generally, the default settings are enough for most people. The main setting you will most likely change are adding more adlist to Pi-Hole. As of May 2021, Pi-Hole comes with one adlist by default.
Select Group Management – > Adlists to manage adlists.
Step 4: Set your router’s DHCP or computer’s DNS to Pi-Hole
Since everyone will have different network setup, it is best to do some research on the router you have for your network.
If you do not know the settings for your router, you can alternatively set the DNS setting locally on your computer. You will have set the DNS setting on every individual devices to Pi-Hole if you choose to do it this way.
For Windows computer, the setting can be found in the Start Menu -> Settings -> Network & Internet -> Change Adapter Options
Right-Click on the Ethernet or Wi-Fi Adapter for your computer, and choose Properties. Select Internet Protocol Version 4. Select Use the following DNS Address and enter the Pi-Hole IP Address. Click Ok to save the changes.
Now your computer will make DNS requests to the Pi-Hole, and Pi-Hole will block the Ads before it even reaches your computer.