Pi-hole - whole house ad-blocking via DNS

Handruin

Administrator
Joined
Jan 13, 2002
Messages
13,920
Location
USA
Has anyone here used the pi-hole utility in their environment to manage and block ads throughout their home environment? There is an article here that goes over this in a little more detail for anyone who might be interested. I'm considering setting one up in a Linux VM and then updating my router's DNS to use this so that all the bad traffic can be managed through this device. I believe the idea is you can run this on an inexpensive RaspberryPi to manage the ad-blocking if you don't want to use a VM. If I find it works well, I may consider moving it over to a dedicated device.
 

Newtun

Storage is nice, especially if it doesn't rotate
Joined
Nov 21, 2002
Messages
484
Location
Virginia
That sounds quite interesting. I wonder if that approach would avoid all those "Please disable your ad blocker for our very special site" pop-ups.
 

Newtun

Storage is nice, especially if it doesn't rotate
Joined
Nov 21, 2002
Messages
484
Location
Virginia
I am starting to give this some serious consideration.

One challenge for me is desk space (not disk space :)). I have 4 computers on an old KVM, using PS2 and VGA connections. It seems that my monitor does have the required HDMI connection, but I would have to get a USB keyboard (and mouse?), and somehow clear space for them and the Pi on my very cluttered desk.

I assume that I would have to connect to the Pi occasionally for security/software/blocking-config updates, it's not just a "set-it-and-forget-it" EOT "appliance".

I found this tutorial that makes it seem easy to set up, but it doesn't cover how to do those updates. But it would be great to have "whole-house" ad blocking on my network, including on our phones.
 

Stereodude

Not really a
Joined
Jan 22, 2002
Messages
10,865
Location
Michigan
How does this really differ from adblocking and blocking scripts in your browser? It seems like it would be less effective, but I have a number of Raspberry Pi 3's I could try it on.

Edit: Plus, if it breaks a website, you have to change your DNS setting to fix it or try to fix the whitelist/blacklist in the Pi-hole (assuming you can determine which domain is the problem)?
 
Last edited:

LunarMist

I can't believe I'm a Fixture
Joined
Feb 1, 2003
Messages
17,497
Location
USA
How does this really differ from adblocking and blocking scripts in your browser? It seems like it would be less effective, but I have a number of Raspberry Pi 3's I could try it on.

Edit: Plus, if it breaks a website, you have to change your DNS setting to fix it or try to fix the whitelist/blacklist in the Pi-hole (assuming you can determine which domain is the problem)?

There must be some way to easily disable the Adablocker or else that system will be worthless on many sites.
 

Stereodude

Not really a
Joined
Jan 22, 2002
Messages
10,865
Location
Michigan
How would you fix resolving local hostnames with a Pi-Hole?

With my current network setup most of the systems are DHCP. Their hostnames resolve on the local network because the router handles DHCP assignments and DNS. Local hostnames are automatically put into the DNS table and resolve accordingly. If you move DNS to the Pi-Hole you'd need to make your router pass out DHCP data that has the IP of the Pi-Hole for DNS instead of the router (which isn't a problem to configure). However, the Pi-Hole would need to go straight to the internet for DNS lookup which means no local hostnames will resolve on the network. Short of moving DHCP assignment for the network to the Pi-Hole I can't logically work out how to use it for adblocking and still have resolution of local hostnames.

Did I overlook something?
 

Stereodude

Not really a
Joined
Jan 22, 2002
Messages
10,865
Location
Michigan
So I decided to give it a quick test on a RPi3 basically following this guide. Note that Raspbian defaults to a UK keyboard layout and you can't enter a | character from the keyboard until you change it to a US keyboard by running sudo raspi-config.

I didn't do a full network integration. I just manually set the DNS on one of my PCs to use the Pi-Hole instead of the router. It generally cleans up the web, but some ads on some sites still get through that would be killed by uBlock Origin if used. FWIW, they're not particularly flagrant ads from what I've seen so far. Pi-hole doesn't really help with excessive scripts either (though they don't claim to).

My initial impression after less than an hour of use is that you'd probably still want to run ad + script blocking on top of using the Pi-hole if that's what you've been using all along. Script blocking on top of it at a minimum. I don't really see it as a fix all. Especially not for a laptop if you take it out of the house and connect to other networks.

It also breaks things. For example, you can't watch full episodes on CBS's website when using it (you get an error message about the video being unavailable and playback won't start). uBlock Origin has no such issue. Playback starts and it prevents the commercials.

To me the biggest benefit I see is that the Pi-Hole helps reduce the ad load in browsers that don't offer ad blocking.
 

Stereodude

Not really a
Joined
Jan 22, 2002
Messages
10,865
Location
Michigan
How would you fix resolving local hostnames with a Pi-Hole?

With my current network setup most of the systems are DHCP. Their hostnames resolve on the local network because the router handles DHCP assignments and DNS. Local hostnames are automatically put into the DNS table and resolve accordingly. If you move DNS to the Pi-Hole you'd need to make your router pass out DHCP data that has the IP of the Pi-Hole for DNS instead of the router (which isn't a problem to configure). However, the Pi-Hole would need to go straight to the internet for DNS lookup which means no local hostnames will resolve on the network. Short of moving DHCP assignment for the network to the Pi-Hole I can't logically work out how to use it for adblocking and still have resolution of local hostnames.

Did I overlook something?
Yes, I overlooked setting my router to use the IP of the Pi-Hole as the DNS server instead of the one I'm currently using. It ads an extra hop, but would keep local hostname resolution working. I'm not sure why I thought this wouldn't work initially.

Still, I currently don't plan to use Pi-Hole.
 

Handruin

Administrator
Joined
Jan 13, 2002
Messages
13,920
Location
USA
I still haven't had a chance to go through this yet but I'm still interested in giving it a try. One of the items that had me interested in in Pi-Hole being able to stop other devices like my Roku from sending back traffic without me knowing. That's where I originally found this to be interesting. I realize I will still want a browser plugin to block other things but this can also help stop rogue IoT type devices from relaying details you may not want or know about.
 

Stereodude

Not really a
Joined
Jan 22, 2002
Messages
10,865
Location
Michigan
I still haven't had a chance to go through this yet but I'm still interested in giving it a try. One of the items that had me interested in in Pi-Hole being able to stop other devices like my Roku from sending back traffic without me knowing. That's where I originally found this to be interesting. I realize I will still want a browser plugin to block other things but this can also help stop rogue IoT type devices from relaying details you may not want or know about.
Isn't that more of a firewall function?
 

sechs

Storage? I am Storage!
Joined
Feb 1, 2003
Messages
4,709
Location
Left Coast
Beyond finer control, how is this better than the DNS blocking that my router provides already?

Thanks to HTTPS, we still need browser-level ad blocking.
 
Top