A few months ago I purchased a Raspberry Pi Zero with the intent of getting rid of a power hungry server I have in the basement. I use the server for several things: 1. it is a file server that we store all sorts of pictures and documents on. It gets backed up each night to the cloud so I know all our documents are safe and I can access them when ever I need to. 2. the server is hooked up to our color laser printer. I bough this printer many many years ago in another business and it has been a work horse for more that 15 years. It has all the features I could ever want and has just worked for all these years. Ok I had to replace a few parts that wore out, but I am not going to complain. After looking at the Pi Zero I decided to not go the route of replacing the server. At least for the time being and use it for anything else. I just didn’t know what that would be, until….I decided to try a Raspberry Pi Zero Pi-hole set up.
Skimming through reddit I came across a post about “the best things to buy under $50” and using a Raspberry Pi to block ads on your entire network caught my eye. They talked about this software called Pi-hole. Pi-hole is a DNS server software that blocks ad domains on your entire network. WHAT EVIL IS THIS? I am all for ads I use them on this site and a few others to make money so blocking ads isn’t my favorite thing in the world to do. I also hate the number of ads and how intrusive they can be. Especially on Facebook and some other social networks. Placement of ads is something for another post.
Let’s get to the good part, Raspberry Pi Zero Pi-hole set up. This literally took me less that 20 minutes to do. I wasn’t 100% sure the Zero would be fast enough to run as a DNS on my home network, but I figured I would give it a try and see what happened. I wasn’t out anything if it failed or slowed down my network at all and would just take it back out and live with the ads.
My hardware consisted of: a Pi Zero (original not a W), a Case, 4GB SD card with Jessi Lite flashed already, and a Ethernet Hub/USB Hub. My Zero is without WiFi and I am not sure I would want to add this type of device to the WiFi. I also used an old cell phone power supply I had laying around for power.
Pi Zero setup
The first issue I had was, I didn’t have an HDMI monitor to hook to the Pi Zero for set up. (Yes I know I still live in the dark ages of monitors.) This wasn’t a huge issue, I just didn’t know how to set up a headless system like this. After a little Google-foo I found out that Raspberry Pi’s have SSH off by default as a security feature. This is simple to get around by accessing the SD card on my Windows machine and adding an empty file named SSH with no extension to the root directory. Plug it into the network and find the IP address on your router. Fire up the Pi Zero on the network, Putty to the IP address and log in. The root username and password are pi and raspberry. I would suggest changing the root password as soon as you are in.
The second thing is to download the Pi-hole software to the Zero. This too was pretty simple. Using the following command:
curl -sSL https://install.pi-hole.net | bash
It took a few minutes to download. Once downloaded there are several setup options that Pi-hole asks during the set up and truthfully you can leave most of the defaults because you can change all of them through the admin page. When all is complete the Pi-hole will show you a final configuration screen with the address to the admin page and password. You will want to copy the password down somewhere as you will need it later and it can’t be recovered if you lose it.
The last part was even easier. Log into your routers admin site and set the DHCP settings and set the primary DNS server to your PI’s IP address. Save it and reboot your router just to be safe.
Pi-hole Admin Page
You can then navigate to the Pi-hole admin page that was given to you after setup. You should start seeing some results. The counts will start going up as you start using the network. It took about an hour for all of our devices to adjust to the new DNS server, but after that I could see a noticeable increase in network speed. I started going out to Facebook and would go to a page that I knew would have a ton of ads. There was nothing but clean content and no intrusive ads all over the place. Even the ads on our Roku where gone and it allowed us a better streaming experience.
Pi-hole admin log in
You can log into the admin site using the password provided earlier in the setup. This will give you access to other reports and settings that you can change if you didn’t get it quite right during setup.
I was pleasantly surprised that the Raspberry Pi Zero Pi-Hole set up handled the traffic without any hiccups and the speed of our network increased drastically. The Pi-hole admin interface has a handy little status section to tell you how hot the Pi is and how much of a load is on it at any given point. After a couple of hours you will start to see the graphs and other information being populated. You will get fun stats like the top using IP address and top advertisers blocked.
Words of caution
This isn’t an end all setup. I still get the occasional ad that gets let through and I am ok with that. Pi-hole doesn’t work on Hulu ads at the moment, again not really a deal breaker for us. Also if there are sites that you are use to having access to and you no longer do. The site may need to be white-listed within the Pi-hole to allow it through. Finally I have noticed if you use “Google” as your upstream DNS you may miss some sites as well. I would recommend OpenDNS instead. OpenDNS just seems to function better and let the correct sites through.
There you have it. Pi-hole runs on the raspberry pi Zero without any trouble. Here to enjoying life with a few less ads using your Raspberry Pi Zero Pi-hole set up. This excited me to see what other useful projects I could find for a Raspberry Pi.