Last week I built a Pi-hole with the Raspberry Pi. The reason for this project was to block ads on the home wifi network and this seemed to be a beginner friendly project in terms of the documentation on the internet.
I needed a Raspberry Pi 3 with a 8gb SD card, a USB cable, a monitor/display, a keyboard, a mouse and an ethernet cable. The process is listed out below:
-
Download Raspbian Operaring System with NOOBS (New Out Of Box Software) onto your laptop/computer and load it onto the blank SD card.
-
Load the SD card into the Raspberry Pi and connect it to the power supply, monitor, keyboard and mouse.
-
Complete installing the Raspbian Operating System (this does take some time so grab a coffee/tea).
-
Once the initial installation is complete and I logged in with the default username/password (which I did change later) and installed Pi-hole using:
curl -sSL https://install.pi-hole.net | bash
-
During installation process an admin password and a dynamic IP address is randomly provided for use as a static IP address in the 192.168.x.x format. The Raspberry Pi was now running a DNS server.
-
Once this initial setup was completed I changed the IP address provided by Pi-hole to a static IP address for custom DNS server settings for the home wifi network. I chose a static IP address from a range that was different from the IP address range the DHCP accesses as default from the router. This eliminates risk of IP address duplication which would normally be the case when assigning static IPs and any implications thereof.
-
I enabled the DHCP Server in the Pi-hole instead of changing the router’s DHCP options to act as a DNS server. Both of these achieve the same effect but for me the former was more applicable for the home wifi network.
This set up now ensured that any client requests from a device are forwarded to the Pi-hole (acting as a DNS server) from the router before reaching the wider internet.
The resources I found helpful to understand the networking side of things were:
The resources for setting up Pi-hole were:
comments powered by