Live data from Hacker News

Block ads on home devices using a Raspberry Pi

medium.com

1–10 of 25 posts

Re: Block ads on home devices using a Raspberry Pi

#2
This is just DNS-level blocking; I'm pretty sure you can do this already if you have a Linux-based router that has a DNS server+resolver built in (i.e. most of them), but if you have an RPi lying around doing nothing, might as well put it to use.

Note that this doesn't block ads which are inlined and/or otherwise combined with content; for that, you can use a MITM proxy like Privoxy.

Re: Block ads on home devices using a Raspberry Pi

#5
post #4
post #3

Why not just use a hosts file?

1) This is centralized so you wouldn't have to edit on every PC/device 2) It's a bit tricky to edit the hosts file on an iPhone..

re #2: it's only two steps to install a proxy-based adblocker and then set a proxy for your internet connection. Same goes on Android.

Re: Block ads on home devices using a Raspberry Pi

#7
post #4

Earlier quoted context omitted.

1) This is centralized so you wouldn't have to edit on every PC/device 2) It's a bit tricky to edit the hosts file on an iPhone..

re #2: it's only two steps to install a proxy-based adblocker and then set a proxy for your internet connection. Same goes on Android.

A filtering proxy takes many more CPU cycles than this solution.

This is a lot more efficient.

Re: Block ads on home devices using a Raspberry Pi

#8
This seems kinda half-assed.

If he's setting up dnsmasq to serve as a caching local DNS, why not configure it to serve as DHCP server as well (after disabling DHCP on the router) and avoid the manual setting of the DNS server on clients?

Re: Block ads on home devices using a Raspberry Pi

#9
post #4
post #3

Why not just use a hosts file?

1) This is centralized so you wouldn't have to edit on every PC/device 2) It's a bit tricky to edit the hosts file on an iPhone..

You can put a hosts file on your router. That way it is automatic to ALL devices, no need for DNS tinkering.

Re: Block ads on home devices using a Raspberry Pi

#10
post #4

Earlier quoted context omitted.

1) This is centralized so you wouldn't have to edit on every PC/device 2) It's a bit tricky to edit the hosts file on an iPhone..

re #2: it's only two steps to install a proxy-based adblocker and then set a proxy for your internet connection. Same goes on Android.

A hosts file on a router would be much faster than anything else. Nullrouting packets before they even enter your LAN is possible the best thing you can do.
Post reply on HN