Skip to main content

Pi-Hole Ad blocker.

By January 24, 2016No Comments

I had a few (quite a few actually) Raspberry Pi’s around and having read about Pi-Hole I decided to put it to good use.

I’ve been using an adblocker for a while, and I’m not getting into the ethics of it but a) I don’t click on ads b) I honestly don’t care about the ethics of it, if I can improve my online experience I will.

So I decided, having just reconfigured my home network in advance of finally getting fibre, to add a pi to remove as many ads as possible for everyone on the network.

The process is very simply – put an iso of Raspian on an SD card (or Micro SD for me as I’m using a pi 2.0) – I used Raspian Jesse light from here with no issues.

Ssh into your pi -ssh pi@your-ip , password raspberry – I like to use fing (available on iphone and android) if I can’t find it immediately on the network.

Literally cut and paste

curl -L | bash

into the terminal and you’ll be walked through the process. Use the down button to also block ipV6 ads (new option), wait for it all to run and install – 10 minutes or so, then you are done. You can check your PiHole webserver at http://xx.xx.xx.xx/admin/index.php

You can either change the DNS server of each device in your home to the 2 dns servers Pi-Hole suggests you use – or dig into your router to block everything at router level. I did the latter, so its now all automatic.






I also downloaded this hosts file – following a tip on reddit –

This host files is nicely maintained by Steven and kills some trackers as well as ads – and who wants to be tracked..

I didn’t think instructions to get this into Pi-Hole were clear so here you go –

I downloaded the hosts file and cleaned up the header then searched and replaced to remove the 0,0,0,0 entries. Uploaded it to my server.

I ssh’d into the pi again and used wget to pull the file down then

mv newhostsfile.txt /etc/pihole/blacklist.txt



Pi-Hole then runs and adds another 27,000 adserver and trakers to your blocklist. Nice.

So almost 10% of my traffic is ads – and so I’m saving a good chunk of my bandwidth by doing this. Cost = Raspberry Pi, and less than an hour. Donate if you use it – its useful software and the stats are cool. Its under active development, so definitely worth a try.






Leave a Reply