Skip to Content

Setting Up Pihole

Posted on
Pi-Hole on the network
Pi-Hole on the network

Are you interested in blocking ads for your whole network? Turns out there’s a really simple and polished tool for that: Pi-Hole. Starting with your favorite Pi distro you can have your ad blocker up and running in about 10 minutes. For this project you’ll need to have just a pi (with networking), and good power supply, and and SD card.

Before you start you should make sure you have a static IP to assign to your Pi

I highly recommend you plug the pi into ethernet once it’s deployed

Start by burning your favorite distro (I use Raspbian Lite) to your SD Card. Etcher is a great tool for burning images. Before you boot your pi we’ll make some changes to the files on the SD card. Re-insert the SD card and then open /config.txt and set gpu_mem=16, save, and close. If you need to use wifi for the initial configuration then follow these instructions.

Next, insert the SD card, connect the pi to ethernet and plug in the power. Wait a minute and then run

ssh pi@raspberrypi.local

and enter the password raspberry. Typically the first thing to do on a new device is upgrade all of the packages. On Raspbian that’s as simple as running

sudo apt update; sudo apt upgrade

Finally, install Pi-Hole by running their installer (with the usual caveats about piping internet scripts into a shell)

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

The installer does a nice job of sorting out networking for you, you just need to enter the static IP or stick with DHCP if you’re assigning it that way. When the installer is complete it will spit out an admin password so record that somewhere. Now you can visit the admin dashboard to ensure its working.

Before you deploy the Pi-Hole on the network change the DNS server of your local machine to the Pi-Hole’s IP and make sure DNS is still working. Use the dashboard to confirm your machine is using the Pi-Hole. When you’re ready change the DNS servers for your network just add the Pi-Hole before your existing DNS servers. Do not replace your DNS servers with just the Pi Hole. On my network the second DNS server is my router and its DNS servers are 1.1.1.1 and 1.0.0.1.

I installed Pi-Hole on a 1st-gen Raspberry Pi witch has just 1 core and 512MB of RAM. It’s running really well even on that small a device so don’t feel like you need to dedicate a 3B+ to this project.