Pi-Hole - Raspberry Pi based ad blocker

If you touch your software enough does it become hardware?

Moderator: Forum Moderators

Post Reply
spoodie
Site Moderator
Site Moderator
Posts: 9246
Joined: February 6th, 2005, 16:49
Location: Essex, UK

Pi-Hole - Raspberry Pi based ad blocker

Post by spoodie »

https://pi-hole.net/

I stumbled across this the other day and it seems to work rather well. If you've got a Raspberry Pi lying around, not doing anything, this could be a good use for it. The idea is that the Pi acts as your DNS and blocks any known advert addresses, such as doubleclick.net. It's almost all automated and only requires some basic Linux experience. If you use it then there's no need for browser based ad-blockers and seems faster than using those add-ons as well. Which is especially useful were adblocker add-ons are not usually available, such as on phones, tablets and consoles.

This bloke does a good job of explaining much of process, with some optional stuff towards the end of the video:
[youtube]https://www.youtube.com/watch?v=E--ZteyODyQ[/youtube]

If you're clever you can get your home router to have all the devices on your home network use Pi-Hole for DNS, but be careful as it may block required hosts. I'm still testing and can help if anyone is interested.
Dog Pants
Site Moderator
Site Moderator
Posts: 21653
Joined: April 29th, 2005, 13:39
Location: Surrey, UK
Contact:

Re: Pi-Hole - Raspberry Pi based ad blocker

Post by Dog Pants »

Nice! I don't have a Pi, but stuff like this is making me increasingly interested in one.
Dr. kitteny berk
Morbo
Morbo
Posts: 19676
Joined: December 10th, 2004, 21:53
Contact:

Re: Pi-Hole - Raspberry Pi based ad blocker

Post by Dr. kitteny berk »

There's that new mini pi thing that costs about a fiver. tempting.

Also, This works nicely on machines that will enjoy a hosts file.`
spoodie
Site Moderator
Site Moderator
Posts: 9246
Joined: February 6th, 2005, 16:49
Location: Essex, UK

Re: Pi-Hole - Raspberry Pi based ad blocker

Post by spoodie »

Dr. kitteny berk wrote:There's that new mini pi thing that costs about a fiver. tempting.

Also, This works nicely on machines that will enjoy a hosts file.`
As Pi-hole doesn't need much power a Pi Zero may work. But you'd also need to buy a USB -> ethernet adaptor, not just £5. Or wifi, but the latency may be a problem, you don't want a additional delay in DNS lookups. I don't think my solution is quite fast enough as if I have a secondary DNS configured on the client it seems to use that instead of the Pi-hole.

That hosts file solution is a nice, simple idea, if a little ghetto.
Dr. kitteny berk
Morbo
Morbo
Posts: 19676
Joined: December 10th, 2004, 21:53
Contact:

Re: Pi-Hole - Raspberry Pi based ad blocker

Post by Dr. kitteny berk »

It's ghetto as tits, but it handily knocks all ads on the head, not just in browser ones, Might be entertaining to bounce ad requests to another page, so you know when a page is blocked, or just knackered.

But obviously, a pi-thing, or a proper DNS configured for adblocking would be fucking outstanding.
spoodie
Site Moderator
Site Moderator
Posts: 9246
Joined: February 6th, 2005, 16:49
Location: Essex, UK

Re: Pi-Hole - Raspberry Pi based ad blocker

Post by spoodie »

Dr. kitteny berk wrote:Might be entertaining to bounce ad requests to another page, so you know when a page is blocked, or just knackered.
This is a good point.

Pi-hole has a light-weight web server that supplies a 1x1 gif, instead of the advert. I assume to make sure the browser or whatever gets some kind of response and doesn't wait, causing pauses while a page loads. You could do the same with a small web server running locally on your PC, offering up a small gif in place of adverts so you can see what's been blocked. Say a small red cross or something like that. Then you can differentiate between blocked things and not working things. You'd need to make sure the gif replaces all error code pages as well, as the requests to the webserver will often include URL paths that don't exist.

/edit
Pi-hole blocks a lot of Facebook, this may not be a bad thing.
Dr. kitteny berk
Morbo
Morbo
Posts: 19676
Joined: December 10th, 2004, 21:53
Contact:

Re: Pi-Hole - Raspberry Pi based ad blocker

Post by Dr. kitteny berk »

Probably well worth an advanced fiddle, once I can be arsed.
Post Reply