Damn Small Linux Forums

Full Version: antiX Advert Blocker
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Not sure if this is an issue or not, and not sure if it is directly related to AntiX or DSL, but here goes:

I have a fresh install of DSL 2024 and while changing the name of my server in /etc/hostname and /etc/hosts I came across >75000 entries in my hosts file like this:

# BEGIN (below) - IPs added by antiX Advert Blocker #
127.0.0.1 <my host name>
.
. a lot of the same entries here
.
127.0.0.1 <my host name>
# END (above) - IPs added by antiX Advert Blocker #

I've read a couple of posts on AntiX forums about removing antiX Advert Blocker and I will do that if the hosts file continues to get overrun by these entries. However, anyone have any insight into why/how these entries are being populated?

(cross posted on the AntiX forums)
Folks on the antiX forum are saying this might be a bug in DSL? IDK, but here is the thread: https://www.antixforum.com/forums/topic/...t-blocker/
Yeah looks like you got another one. Keep 'em coming, but my guess is that it's not UNintentional and the precise answer would be John's to provide.

For now, yeah--blow all the dupes out, leave the "sane" bit at the top. Either that or add the block-advert shell stuff, it's up to you. Just the one script from antiX--doesn't really need to even be patched-in to the control center to work--I just tested it all as sudo from the command line and it did the population-bit. As I'm still new here, too, I hadn't gotten that far to decode the antiX filter rules and figure out why that filtering works right (vs. say hosts.deny).

Each of the antiX "levels" (core base full) has a different control center (and accompanying amount of "niceties"). DSL started with base and reduced, of necessity, as we all know, to fit on a CD. I've only installed core and full so I don't know what base has for a CC.

I can't speak for John/DSL, but can only speculate it was one of the choices for reduction. It's actually not that big of a script but it may have overhead I've not learned about yet. It could be worth discussion for inclusion...er not.

If you've dug into how the filtering happens, please let us know. A quick search for all the ufw rules files from the default shows it's quite modular and will take more time than I have right now.

I just used ufw default deny and ufw enable and called it good because I didn't know what ports were open and hadn't probed things yet.

I think the extra layer of hosts.deny / hosts.allow is application-based so the filtering is best done earlier (iptables) IMO, but probably doesn't hurt in both places (layers, etc).

Personally, I have an Adblock plus extension in Firefox, but the antiX way sounds leaner--I just haven't dug that far.

Thanks again--to you and to everyone who is helping. John is a 1-man show and all the help matters.
Thank you for posting this bug. Did you install the antiX package advert-block-antix? Please tell me about your setup, what packages you've installed and how you are running DSL.
Edit, found the bug -- post install. This is definitely not intentional. I'll get back to you when I figure it out.
Okay, this is what's happening...

Package advert-block-antix is not installed on DSL, but I have a fairly up to date list of domains to block in the Live CD. They are being blocked by rerouting the 74124 spam domains to the localhost address at 127.0.0.1.

The installer (minstall) has a little sed script in it:
sed -E -i '/localhost/! s/^(127\.0\.0\.1|127\.0\.1\.1).*/\1

Which is designed to replace the localhost alias with what is chosen during the install process (default is dsl1). So, everything works fine except it overwrites all the spam domains with the local computer alias -- and that's why you get the giant non-nonsensical list!

This is an easy problem to fix and I'll be sure to take care of it in RC6. You can restore the pi-hole blocks by deleting the local alias listed below "# BEGIN (below) - IPs added by antiX Advert Blocker #", install the advert-block-antix package and run /usr/local/bin/block-advert.sh.
Thanks John, glad it is a simple issue. I just randomly came across this as there was no system indication that something was amiss.

So is it required that I install advert-block (as I don't need it) or can I just upload the unified hosts file from here: https://github.com/StevenBlack/hosts
You don't actually need the script if you want to add the hosts in manually.