Blocking Web Ads with Pi-hole!

Those concerned with internet privacy, security, and an ad free surfing experience will love Pi-hole, the “Black Hole for Internet Advertisements”. Pi-Hole runs on a Raspberry Pi, silently blocking over 100,000 internet ad serving domains from your network systems as you surf the web.

For this project, I used Adafruit’s new 2.8” TFT resistive Pi-Hole kit, but it will run on any Raspberry Pi. They have complete instructions for the entire process for their kit here https://learn.adafruit.com/pi-hole-ad-pitft-tft-detection-display/overview

I am only going to quickly cover the install process. If you purchase the Adafruit kit I highly recommend you follow the steps provided on their website!

Install Raspbian Lite

Just download the appropriate file for your Raspberry Pi and write it to an SDRAM card, Etcher works great!

Before you remove the SDRAM card from the writer, add a blank text file to the card with the name, “ssh”, this will enable SSH by default when you boot up Raspbian for the first time.

NOTE: Change your Pi password!

Attach your peripherals to your Pi, plug in the SDRAM card, and apply power to your Pi. You should now be able to SSH into the Pi, or use your peripherals to log in.

Install Raspbian updates

In a terminal run the following commands:

  • apt update
  • apt upgrade

Also, in Raspi-Config if you live in the US, set your locale to “US” – it defaults to “GB” and causes a ton of problems when you run the graphical PADD interface for Pi-Hole.

Install Pi-Hole

Installing Pi-Hole is very simple, From a Raspbian terminal prompt enter:

And then follow through the installation prompts.

Install PADD

The Pi-hole Ad Detection Display or PADD is a nice status interface that works well on the Raspberry Pi. If you are using a TFT screen, installing PADD gives you a very nice interface for Pi-hole:

pi hole closeup sm

Install will depend on what TFT screen you are using, so I just followed Adafruit’s PADD install instructions for my 2.8” screen, located here:

https://learn.adafruit.com/pi-hole-ad-pitft-tft-detection-display/install-padd

Web Interface

Pi Hole’s Web Interface is really slick, it gives you a ton of information in a nice graphical interface. When your Pi-Hole is running, just surf to “[Raspberry Pi IP]/admin”, so if your RPi has an IP of 192.168.1.112 you would surf to “192.168.1.112/admin”.

You would then see a display like this:

pihole web interface logged in

Setting up Clients to use Pi-Hole

Lastly, just set the DNS address of any system you want to use Pi-Hole to the IP address of your Pi-Hole RPi. This varies by Operating System, if you don’t know how to do it, just google how to change DNS addresses for your OS. It will then automatically and silently block web ads as you surf!

Some Issues

I did run into some issues with the Adafruit install directions, but it was more related to the finickiness that you can run into with RPis. The Pi-Hole install directions wants you to rename your Pi. If your Pi-Hole install kicks out a “can’t resolve hostname” during install, it’s because the RPI didn’t update the hostname for your Pi, you just have to edit the hostname file yourself and put in the new Pi name.

If your Pi-Hole install hangs at “configuring resolvconf” your resolv.conf file isn’t pointing to your DNS server (I used “1.1.1.1” to sue CloudFlares DNS service) and just needs to be edited. I had to edit mine several times, it kept losing it on reboot.

It should be a quick install, but figuring out the problems above burned like 3 hours, lol.

Conclusion

RPi related issues aside, the install is pretty quick and pain free. Pi-Hole runs fast and silently in the background with no apparent impact on surfing. I really like the web interface as it displays a lot of detailed statistics about performance and what was blocked. Overall I am very happy with Pi-Hole and gladly recommend it as a Web ad blocking solution.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: