Antix Advert Blocker modifies /etc/hosts file

I went to edit my /etc/hosts file in Antix and had quite a surprise. It looks like this

127.0.0.1       localhost
127.0.0.1    trinity
 
# The following lines are desirable for IPv6 capable hosts
::1             localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

# BEGIN (below) - IPs added by antiX Advert Blocker #
# These kinds of sites are blocked :
0.0.0.0 0.0.0.0 0.0.0.0.creative.hpyrdr.com 0.0.0.0.hpyrdr.com 0003.pages.net.br 000free.us 000.gaysexe.free.fr 000tristanprod.free.fr 002pb.com 004q.info
0.0.0.0 005.free-counter.co.uk 0062155.xyz 006.free-counter.co.uk 006.freecounters.co.uk 00790fca.sibforms.com 007angels.com 007.free-counter.co.uk 008.free-counter.co.uk 008.free-counters.co.uk
0.0.0.0 009.itpolska.click 00author.com 00d4b35ffed.johncornell.com 00ea1b98c1e.chefs-kitchen.co.uk 00fun.com 00go.com 00it.com 00lx.184181231.xyz 00lx.8856574.xyz
0.0.0.0 00lxpurchase.9076565.xyz 00sexus.com 00vy.za.com 00webcams.com 00wp-pl.000webhostapp.com 00wp-pl1.000webhostapp.com 00x.eu 0101011.com 010sec.com
0.0.0.0 011707160008.c.mystat-in.net 017gj.com 0192s.byseniscon.top 019f43-2.myshopify.com 01apple.com 01mspmd5yalky8.com 01-sex-amateur.info 020000333.xyz 0202.com.tw
......

Then follows 16082 lines like the last two.
It is blocking sites by mapping them to 0.0.0.0

Never seen this before , so I searched…in
Control Centre → Network
there is a thing called ‘Adblock’

and if you go into Acblock you get

and if you say OK you get

So there are choices of what to block or unblock. It is set to block most things by default, and it really is a feature of Antix.

I have never seen such a thing before. Do other ad blockers work this way by writing on /etc/hosts?
It disturbs me a bit… the hosts file is rather messy.
What do others think of this?

3 Likes

The hosts file is the place to do it. It allows for ad-blocking at the DNS level… that is, if your hosts file is respected by your DNS providing daemon.

2 Likes

There was apparently some mention of this in a previous topic

It went over my head.
It seems more like website blocking than ad blocking?

1 Like

Hi Neville
I noticed the same antix advert blocker is in MX Linux settings.
I haven’t enabled it but did a bit of digging and found this.

https://www.reddit.com/r/MXLinux/comments/jhn3h6/mx_tools_adblocker_how_does_it_work/

1 Like

Interesting. From where it pulls the blocked site lists? Maybe we could have a separate file which would be updated once a week from the source of the blocked sites list and it would be linked to /etc/hosts?

1 Like

There is some comments on sites that microsoft is blocking google sites, not sure if it is true, to push more onto edge.

Also google is removing adblocking tools as its integrated into chrome now automatique

But who controls the list ?.
Got to say as a google user prefered I see less and less ads and dont use a blocker. Just have an issue with one newpaper site which insists on pubs every page loaded, but its not a real news so no big deal

But could do with a stop of adverts on youtube without paying premium

I prefer using a service like https://dnsforge.de for ad blocking.

1 Like

I looked in MX, but did not find it. Must look again… you say in Settings?
Not surprised, MX is derived pzrtly from Antix.

There are Github sites with lists

There are more
https://www.reddit.com/r/linuxquestions/comments/q5quf9/how_to_use_hosts_file_to_block_ads

2 Likes

My German is rather limited, but I gather it is a browser addon… like Ublock Origin.?

1 Like

I think if you use youtube in a browser, and use a browser addon blocker like Ublock Origin or the one @abu recommended, you may get what you need.

1 Like

I used to do something similar ~20+ years ago with Windows (XP?)…

C:\Windows\System32\drivers\etc\hosts

Then I discovered that somehow - Microsoft Windows could also use C:\Windows\Help\hosts! WTF? And I found some malware that used the file in Help!

I mostly only use Brave these days - so don’t really need ad blocking…

I’d hate to have my Linux /etc/hosts file 10’s of 1000’s lines long… Because I do use it for local stuff…

It’s a shame /etc/hosts can’t have “includes” like ~.ssh/config…

2 Likes

Good idea. Who do we lobby to get that? Kernel developers I suppose?

1 Like

No, it’s a DNS-Resolver that filters ads, tracking and malware.

3 Likes

I suppose you could say that the hosts file is a primitive DNS-resolver
With dnsforge, does it outsource the resolver work to their server, or do you install something?

1 Like

Yes.
From the main menu


Or under the ‘Other’ section in the settings window

3 Likes

Nothing. Just tell the browser to use it instead of the default. (Cloudflare)

1 Like

I see. I have something to learn here.
My firefox has this

So I can choose another provider, as you indicate.
There is the Max Protection option too. ( What is that?)

It helps now that I have translated your webpage

It tells me exactly what to do.

2 Likes

Thanks, Gary. I found it.
The menus look identical to the Antix ones .

2 Likes

Have a look at VacuumTube

3 Likes