Looking for ad block options for any Linux distro

MX has an ad blocking feature (app) that needs to be enabled manually.
It serves to block all ads flowing through the internet.
Is there something similar for other distros?

Have a look at some of these which may help

I always thought ad blocking was a function inside the mailer or browser. Are you saying there is a feature which works for the whole distro and across all apps?


1 Like

You can use DNS based adblock by setting up custom dns.

In the command line, type:
sudo nano /etc/resolv.conf
Tyoe your password.

Type “nameserver” and one or several AdGuard DNS addresses from the same group (Default, Family protection, or Non-filtering ones).
Default servers
If you want to block ads and trackers.
Non-filtering servers
If you don’t want AdGuard DNS to block ads and trackers, or any other DNS requests.
Family protection servers
If you want to block adult content, enable safe search and safe mode options wherever possible, and also block ads and trackers.
Press “Ctrl + O” on your keyboard to save the document.
Press “Enter”
Press “Ctrl+X” on your keyboard to save the document.
Close the Terminal.

1 Like

Thank you. Yes I see, you can do it at the network level.


Really happy to help ! :slight_smile:

Interesting stuff!

Does this affect only my computer that depends on a network?

Have access to the Netgear router via Windows 10, but there is no ad filtering option (at least, none that i could see).

Well, the option lies in router’s admin console. If it ain’t there, then you can set up the option on your PC and other devices.

Take a look at Quad9.net , who recently moved to Switzerland. " An open DNS recursive service for free security and high privacy."

Quad9 is good. Pretty safe too.

Interesting find.
Have you been using it?

Recently I installed the Pi-hole software on my Ubuntu 21.10 AMD laptop. Works great.

1 Like

Appreciate that feeback!

Just a bit wary about something like this to be free (donationware).

For several years now, upon installing dnscrypt-proxy which takes over the matter of dns on Linux. Upon startup, dnscrypt-proxy queries a list of servers (or specified ones) and selects the fastest ones for use. This list is of dns servers who are in harmony with dns encryption.
The quad9 servers were normally the fastest. Now that you can actually get the quad9 app, I use it on my Android phone as well.
dnscrypt-proxy can be had here, with full instructions:

1 Like

If you’re referring to Pi-hole https://pi-hole.net/ from all that I’ve heard it’s legit software. Nothing dodgy. Has anyone heard anything negative about https://pi-hole.net/ ?

@m3110w and @kgwoo - have greatly appreciated your input in this subject which is largely uncharted territory for me. :slight_smile:

Will do all possible to share the info. here so that others come to know and appreciate this too.

Another option you can look into that gives you a lot of flexibility in what’s blocked is your system’s hosts file. It’s the protocol that your system checks when it starts to access anything online. There are several online hosts files you can download and use. Get on github(.)com and search for ‘hosts file’ and you’ll get a bucket load of hits.
I use Linux and I tossed a script file together that I use to download several files, concatenate them, sort out the cruft and remove some entries that interfere with captchas. If you stick with just Steven Black’s series of hosts files you don’t often run into this problem. He has his files broken down into individually blocking gambling, ads, known malicious sites, fake news, p0rn, even social sites if you want to go that far. You can find his assortment on github.
The hosts file is a simple and flexible way to block domains before they even download a single thing to your system. Browser ad blockers allow that stuff to download, then they block it at the browser level. The hosts file prevents any of that stuff from even getting on your system. This should be updated at least weekly. You can do this manually, or there are some utilities that can help you out, or, you could do what I did and make your own utility. Of course I used bash, but Window’s users can use batch or whatever other language you might be familiar with. Just be sure to backup your original hosts file header so that if you mess up and erase any of it, you can easily put it back the way it should be.
Another note for Linux users, look in your package manager and see if you have Privacy Badger. As a system download it helps monitor and cover all your apps from trackers, plus you can download the individual Privacy Badger addon for each of your browsers. I’m not sure, but Privacy Badger might have a system download for Windows too.
I’ll agree with others who have recommended DNS proxy services. OpenDNS is one I’ve used. It’s OK and easy and a one-shot deal, but you have to purchase the pro plan to get beyond basic blocking and gain flexibility unless you pair it with using the hosts file for adding extra blocking which isn’t a bad way to go either.
The hosts file is easy too, you just have enabled lines and commented lines. Commented lines or sections of lines are preceded by the # sign which blocks processing. For example; bullcrap(.)com # without the parenthesis would block bullcrap(.)com and the # allows you to add material like this as comments that don’t affect the action of the hosts file. You can find much more information about how the hosts files work and how to use them.

1 Like

Someone also suggested ControlID:

I found a few good options for adblocking in Linux :

Option 1 : For extreme adblocking.
configure hBlock

Option 2 : For simple and solid adblocking.
Create own script file like mine akm-scripts/blockhosts.sh (only for arch linux users)

I use Brave - and - pi-hole, on a Pi…

Had a couple hairy moments today, I updated my pi-hole from 5.x to 5.9 - and IT KILLED MY DNS! I have to remove it (I manually add it to the DNS settings for IPV4 for my ethernet NIC) and re-add using DHCP to pick up DNS server…

Note sure what’s going on… But IT KILLED my VPN session to work, and I was in the middle of creating some DANK memes (Vladmir Putain [sic]

, and Australian “prosperity gospel” politicians) and couldn’t upload them - THANKS PI-HOLE! and my schedule change to install McAfee (yeah - that’s lame!) on some RHEL 7 servers got delayed by an hour, cause my VPN session got booted (and it took me 15-20 minutes to realise my issues were DNS and my Pi-Hole!)…