Page 1 of 1

Pi-Hole - Raspberry Pi based ad blocker

Posted: January 23rd, 2016, 17:25
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.

Re: Pi-Hole - Raspberry Pi based ad blocker

Posted: January 23rd, 2016, 17:40
by Dog Pants
Nice! I don't have a Pi, but stuff like this is making me increasingly interested in one.

Re: Pi-Hole - Raspberry Pi based ad blocker

Posted: January 23rd, 2016, 18:52
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.`

Re: Pi-Hole - Raspberry Pi based ad blocker

Posted: January 23rd, 2016, 19:32
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.

Re: Pi-Hole - Raspberry Pi based ad blocker

Posted: January 23rd, 2016, 21:03
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.

Re: Pi-Hole - Raspberry Pi based ad blocker

Posted: January 24th, 2016, 11:30
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.

Re: Pi-Hole - Raspberry Pi based ad blocker

Posted: January 24th, 2016, 12:03
by Dr. kitteny berk
Probably well worth an advanced fiddle, once I can be arsed.