this post was submitted on 15 Jun 2024
21 points (88.9% liked)

Linux

5022 readers
57 users here now

A community for everything relating to the linux operating system

Also check out !linux_memes@programming.dev

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 1 year ago
MODERATORS
 

Pi-Hole and similar DNS adblockers just seem like a hassle. I can't tell my parents to buy a raspi, flash it, install and configure pi-hole, configure their routers or devices to point to the raspi, and do all of that from another city. Also personally, there's no time for that in my house.

Is there a program or systemd service I can run that pulls blocklists from somewhere (git, http, ...) and updates /etc/hosts? Before I go off and write a python script, systemd unit file, and shell script to install it on the linux systems of friends of family, does this exist?

Resolution comment: Tblock

all 11 comments
sorted by: hot top controversial new old
[–] BB_C@programming.dev 13 points 3 months ago

DNS blockers became a thing in part because /etc/hosts can't do stuff like glob subdomain blocking, no?

e.g.

*.bla.tld 127.0.0.1
[–] Oisteink@feddit.nl 8 points 3 months ago (1 children)

Re-invent the wheel - it’s always less hassle! I’m quite sure your script will be far better and more stable than setting up a dns server to do the blocking.

You can’t change their routers name server but it’s easy to install scripts on their devices?

Just put pihole or other dns server with blocklists somewhere on the internet (you can even host that at your own home!!) and point their routers upstream dns to it.

[–] mikyopii@programming.dev 6 points 3 months ago

Just run Pi-Hole in a Docker container on your machine. Point your nameserver to localhost and reap the benefits.

[–] infeeeee@lemm.ee 5 points 3 months ago

Ublock Origin is not an option? It automatically updates blocklists, and can block ads served from the same domain as content, where hosts based blockers can't help.

Afaik dns based blockers like pihole are useful for locked down systems (iphones, smart tvs, consoles, not rooted android phones) where you don't have access to other ways of blocking ads.

[–] carlytm@lemm.ee 2 points 3 months ago (1 children)

I think Tblock should do what you're asking for.

[–] onlinepersona@programming.dev 1 points 3 months ago

This is absolutely what I'm looking for! Thank you.

And it's even hosted on codeberg 💘 Awesome.

Anti Commercial-AI license

[–] bloodfart@lemmy.ml 1 points 3 months ago

I know you already found something that fulfills your needs, but the mullvad doh servers can do blocking and then you’re doing dns over https with dnssec and a few blocklist options.

maybe the scheduler cron in combination with git might work for you?

[–] YurkshireLad@lemmy.ca 1 points 3 months ago

Run pihole on a server somewhere, accessible only via a vpn. Install the vpn on their devices.

I haven’t tried this but I recall someone saying it was how they had it setup.

[–] RonSijm@programming.dev 1 points 3 months ago

You can use Tblock - Or you can check which router they have, and tell them to flash it with FreshTomato

Then their router can service as a raspi with a pihole: https://wiki.freshtomato.org/doku.php/advanced-adblock