Live data from Hacker News

Ad blocking with Raspberry Pi and Pi-hole

cri.dev

101–110 of 163 posts

Re: Ad blocking with Raspberry Pi and Pi-hole

#101
post #79

Earlier quoted context omitted.

Each cache entry needs a hash bucket so we can look up the entry in O(1), and we need more hash buckets than entries to minimize cache look up time. The hash bucket needs a copy of the element for each hit (to verify we hit the correct hash bucket), and a possible link to the next hash bucket, just in case we got a hash collision (we still need to store that link in memory as a null pointer regardless). [1] The strin…

Instead of building hash tables with buckets (and a linked list in case of hash collision), why not use a flat array based hash table and open addressing?

I actually tried that with MaraDNS in the pre-1.0 days (in case of collision, go forward in hash array N elements until there is no collision).

The problem is that it works really great for static data, but doesn’t work for dynamic data as cleanly as using a linked list to handle collisions.

The one thing I would do differently is that Deadwood (MaraDNS’s recursive/blacklist DNS server) adds individual elements with malloc() and removes them with free(); doing things that way is OK for relatively small data sets on a desktop class computer, but some embedded systems don’t handle the stress of a lot of malloc() and free()s very well, and doing it that way uses a significant amount of memory per element.

Re: Ad blocking with Raspberry Pi and Pi-hole

#102
post #82

I actually have been doing some work with MaraDNS to have the ability to have a pi-hole sized blacklist. The main source of pi-hole’s blacklist is this Git repo: https://github.com/StevenBlack/hosts That is about 60,000 hosts, so I added MaraDNS support to have up to 500,000 blacklisted names. Since it’s a speed-optimized (not size-optimized) cache, each element takes about a kilobyte of memory, so a blacklist this s…

Will you test the efficiency of the block list. For example, given a block list of 60,000 how many hosts on the list did your computer actually try to access. Have you ever read through one of those massive blocklists. I use a whitelist rather than a blocklist. Similar to a firewall, I block everything by default. Then carefully choose what I allow. This way I can see exactly what hosts I actually need to access. Mak…

MaraDNS (OK, Deadwood) can handle white lists too:

    upstream_servers = {}
    upstream_servers["."] = "192.168.253.253" # Never answers
    upstream_servers["good-domain.example.com."] = "9.9.9.9"
    upstream_servers["whitelist-entry.foo."] = "9.9.9.9"
    # And so on
The downside is that the code currently only supports 20,000 elements added this way.

Re: Ad blocking with Raspberry Pi and Pi-hole

#103
post #20

Is anyone successfully using PiHole with non-technical users? My main concern with putting PiHole on my home network is that for example my mother in law might not understand that she can't get to some web page because it's being ad-blocked, nor would she be able to go to the web admin page and temporarily unblock it. Even as a technical person sometimes it takes a while to figure out that a page isn't working becaus…

I set up DNS-based ad-blocking for my parents via Eero. The app-based ad-blocking toggle is easier than something with a web admin interface for them to manage.

Re: Ad blocking with Raspberry Pi and Pi-hole

#104
post #98
post #20

Is anyone successfully using PiHole with non-technical users? My main concern with putting PiHole on my home network is that for example my mother in law might not understand that she can't get to some web page because it's being ad-blocked, nor would she be able to go to the web admin page and temporarily unblock it. Even as a technical person sometimes it takes a while to figure out that a page isn't working becaus…

You say it like its a bad thing. Same person wont understand why putting your password into random website is bad, or why all of those windows and notifications keep popping up, or why you shouldn't click download followed by clicking run on random websites.

agreed

Re: Ad blocking with Raspberry Pi and Pi-hole

#105
post #63

For OpenBSD users there is unbound-adblock[0]. It's a small shell script that uses only in-base utilities and can be run with minimal privileges. [0] https://www.geoghegan.ca/unbound-adblock.html

Similarly, there is also void-zone-tools[1] for FreeBSD.

[1]: https://github.com/cyclaero/void-zones-tools

Re: Ad blocking with Raspberry Pi and Pi-hole

#106

I currently use a 3-layered solution: browser blockers -> custom host file on each machine (StevenBlack hosts for linux and windows, nebulo for android) -> nextdns I'm actually satisfied, but I'm trying to setup pi-hole+unbound on a cloudatcost host I own to reduce the load on nextdns, so far without success.

Pi-hole is just a script wrapper around dnsmasq. On a host or server you might as well just do it straightforwardly:

https://sfxpt.wordpress.com/2011/02/21/the-best-ad-blocking-...

Re: Ad blocking with Raspberry Pi and Pi-hole

#107
post #20

Is anyone successfully using PiHole with non-technical users? My main concern with putting PiHole on my home network is that for example my mother in law might not understand that she can't get to some web page because it's being ad-blocked, nor would she be able to go to the web admin page and temporarily unblock it. Even as a technical person sometimes it takes a while to figure out that a page isn't working becaus…

I've set it up for most of my close family and friends, added a physical button to the top of the Raspberry Pi case that disables it for x minutes (x changes depending who they are and their needs), so if they're having issues they go press the button to access the problematic website. I keep reading about people having to disable the Pi-Hole so much that it becomes annoying, or constantly butting heads with websites…

This is where Firefox DNS over Https comes in handy. I have 2 Firefox installs - Firefox and Firefox Developer Edition with one set to use DOH so always bypassing pihole.

Re: Ad blocking with Raspberry Pi and Pi-hole

#109
post #108

I mean this is a great project and all but don't most moderns routers already have this built into them and are able to add VPNs.

I haven't tried it, but I'd imagine the Pi performs a lot better. I wonder if anyone has benchmarked it against some common routers for this use case.
Post reply on HN