Installing the Raspberry Pi PiHole
The Raspberry Pi has so many different uses. When I bought a Raspberry Pi 3, the first project I wanted to try was the PiHole. The PiHole is a network wide DNS level add blocker for your personal network needs. The best part is.. it’s free! It’s pretty simple to get started as long as you remember to do a few things once the PiHole is installed so let’s get into it.
The first thing you’re going to want to do is figure out what operating system you’re going to be running the software on, and you can find a list of supported operating systems on the PiHole website here. Personally, I chose to work with Ubuntu Server because I like Debian Linux, but there are other options. Once you have installed your favorite OS for the application you need to run this command in the terminal to install PiHole.
curl -sSL https://install.pi-hole.net | bash
- Curl: The curl command is used to transfer data from or to a server, using many supported protocols.
- -SSL: The -sSL flag attempts to connect securely using SSL or TLS.
The rest is the URL and yes, piping it to bash. Piping it to bash is not necesarilly the safest way of doing things. It’s all about trust at that point and when you pipe things to bash, it runs code without you getting the chance to read it first. So if you want to practice better habbits, there’s an alternate way of installing this software on their github page, but I haven’t felt the need to do so with this program.
The last thing you’ll need to do is likely the most important step, for without it, you won’t be able to make use of the PiHole program. You will need to log in to your router and configure the DHCP clients to use the PiHole as their primary DNS server. After this you will need to renew your IP on the devices on your network so they can recieve the new DNS info.
For windows:
ipconfig /renew
For Ubuntu:
sudo dhclient -r
sudo dhclient
After this is all squared away and the add-blocker is up, you can always update ad lists, debug, whitelist, blacklist, view the live log file, and more using the command line or the web interface dashboard using the following formatted address.
http://IP_ADDPRESS_OF_YOUR_PI_HOLE/admin/
Now you can sit back and relax without the clutter of annoying ads in unwanted places. Thanks for reading!