Pi-hole isn’t just fun to say; it’s a network-level ad blocker that operates as a DNS sinkhole. It is designed to be installed on a Raspberry Pi or other small computer. It blocks advertisements and trackers at the DNS level, preventing them from being downloaded and displayed on devices connected to the network.
Pi-hole is particularly useful for blocking ads and tracking on devices without ad-blocking software, such as smart TVs, gaming consoles, and Internet of Things (IoT) devices.
It can also improve network performance by reducing the amount of data that needs to be downloaded, resulting in faster browsing speeds and lower data usage.
The open-source software can be customized to block specific domains or types of content. It can be used in conjunction with other ad-blocking tools for even more protection.
Let us walk you through the creation of Pi-Hole ad blocker setup.
What is needed
- Network / Internet
- Raspberry Pi single-board computer
- Raspberry Pi Imager (software)
- Micro SD card
- Micro SD card reader (if you are lucky, there is a reader built into your computer)
- Ethernet cable
Download and install the Raspbian OS
- Open an internet browser and visit the Raspberry Pi website
- Download the Raspberry Pi Imager software for your current operating system (Windows, Mac, Linux)
- Download Raspbian Pi OS Lite x64 or x32 as needed
- Open Raspberry Pi Imager
- Click on Choose OS and select Raspbian Pi OS Lite or Other, depending on the version of the imager.
- Select Choose Storage button (make sure you select the correct drive letter for your Micro SD card.)
- Select the gear icon (settings)
- We are going to configure a hostname (ie. pihole.local)
- Enable SSH with password authentication
- setup a username and password
- If you would like setup the locale settings
- Select the save button
- Select the Write button
- Once the writing process is complete, remove the SD card and insert it into the Raspberry Pi
Connect and power up your Raspberry Pi
- plug in and power up your Pi
- Finding your Pi’s DHCP IP address is the next step
- If you are on Windows
- open CMD
- type nslookup <system name> (ie. nslookup pihole.local )
- this will return the IP address of the device
- Alternatively, you can look at your router by logging into the admin interface, usually located at 192.160.0.1
- Review the DHCP lease list and find the pihole in the list; it should display the IP address associated with the device.
- once you have the IP address, continue
- in the command window, type – ssh UserName@IP <– use your username and IP address
- enter the password you set up for the user
- We are now going to update the R-Pi; type the following
- sudo apt update
- once that is finished, type the following command
- sudo apt upgrade -y
- your pi-hole server is going to need a static IP address; you don’t want that changing on you when the DHCP lease is renewed. You can set this with a reservation on your router or change it on the R-Pi; this involves using the following command to edit a config file sudo nano -w /etc/dhcpcd.conf <– modify the static IP configuration area of the file, uncomment the lines, and change your settings. Save the file and reboot the Pi sudo reboot
- we logged into our router and added the pi-hole to the reserved IP list; the problem was solved
Installing Pi-Hole
- SSH to your Pi-Hole (giggidy), and then run the following command
- curl -sSL https://install.pi-hole.net | bash
- select OK on the initial screen
- make note of URL and donate (it’s worth it) if you want and click OK
- select continue
- verify that the IP address is the one you have it set to, select yes static IP and select continue
- select OK on the IP conflict screen warning window
- select any DNS provider and select OK
- select yes and enter it on the block list window
- select yes to install the admin web interface
- select yes and enter it on the web server window
- enable logging window is up to you unless you have a specific reason, select yes and enter
- privacy mode window, select show everything and continue
- select OK on the finish installation window
- setup a password for the admin interface
- pihole -a -p
- type in the password
- confirm password
For any device that you want to use to block ads and tracking, just set that device’s DNS setting to point at the IP address of your Pi-Hole server.
Login to the Pi-Hole GUI
- open a web browser
- http://IPaddress/admin <– use your IP address
- login with the admin password you setup
Conclusion
There you have it; you are now the proud owner of yet another Pi-Hole! Enjoy it. If you want further information on deeper details, here are some suggestions.
Pi-hole Documentation: This documentation is a comprehensive resource for understanding Its functionality and configuration options. It covers everything from installation to advanced settings.
Pi-hole Reddit Community: The subreddit is a community of Pi-hole users and enthusiasts who share tips, tricks, and ideas for using it to block ads and improve their internet experience.
Pi-hole GitHub Repository: The GitHub repository contains the software’s source code, documentation, and issues related to the software.
Pi-hole Blog: This blog is an excellent resource for news and updates on Pi-hole and guides and tutorials on how to use and configure it.
Pi-hole Wiki: This Wiki is a user-maintained knowledge base that contains information on using and configuring Pi-hole, troubleshooting common issues, and more.