Adblock-fast: ad-blocking service for dnsmasq, smartdns and unbound

Is there a quick way to suspend/resume ad blocking without having to restart the service?

  1. I have a toggle switch running in HomeAssistant (HA) meant for toggling ads
  2. It can SSH into the router and perform commands
  3. The 3 I need are: suspend, resume and status
  4. adblock has all 3, but it was extremely slow in updating status to the actual value, this makes the toggle switch unusable
  5. I tried the various commands of adblock-fast but they all seem to start and stop the service which is just as slow
  6. Any ideas? Thank you!

The actual adblock-fast stop/start operations are very fast, it's usually resolver (in default installs -- dnsmasq) where restarts are expensive operations. You may want to set dhcp.lan.force=1 to speed it up a bit.

But I do run service dnsmasq restart for other purposes, and it does not take as long as restart the adblock-fast

What does dhcp.lan.force=1 do?

How can I change the StevenBlack - Unified Hosts file? In the StevenBack github repo there are meny combinations of this file, but how to replace the default one in AdblockFast with the one I want to use. Or just an easy way to add it as new, since just adding the github link will not work.

What kind of time difference are we talking about? What's the output of adblock-fast on stop/start?

I'm failing to see what could prevent you from editing/adding new URL given the WebUI and CLI are well documented.

When I try to add the link through the add button it doesn't get processed when AdBlock is started, will appear with that red-cross when i restart through the command line. Obviously just copy pasting the link is not working. That is why I'm asking here and not on the general "network for all" reddit forum. Is it related to needing to add the new file with hosts on "cdn.jsdelivr.net"? I saw through the documentation there is a mentioning of custom filters but points to a document which I don't understand, what I actually need to do to make it working. Hopefully now you understand why I'm asking here.

If this forum is not related to this kind of question, but is related how to add new code and features to the package then ok, I'm in the wrong forum then, I would appreciate if you can tell me the right thread for the above.

What URL are you using for the new list? You must be using an html link instead of a raw link, if I had to guess. Please provide the steps you tried.

1 Like

I used the raw link, for instance this one: https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-only/hosts
I added using the add button at the end
image

I guess its a problem with that list or StevenBlack hosts in general, cause i added something else from raw.githubusercontent and it worked, meaning it reloaded it without error.

Also, like I saw it reported many times before in this thread i also get "Failed to process allow-list!" whenever I do "save and apply" from LUCI. I have to go to CLI and do the reload command, then refresh the view on Luci and that message disappears, it doesn't seem to affect functionality though

It's an issue with StevenBlack lists, some of the lists published there contain non-malicious-domains related records, like:

127.0.0.1 localhost
127.0.0.1 localhost.localdomain
127.0.0.1 local
255.255.255.255 broadcasthost
::1 localhost
::1 ip6-localhost
::1 ip6-loopback
fe80::1%lo0 localhost
ff00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
0.0.0.0 0.0.0.0

So they needed to be sanitized before sending the content to dnsmasq and the tags which I used to filter these records out are not present in all their lists.

Should be fixed in 1.1.8-22 presently available from my repo and I'll merge fixes into 23.05, 24.10 and snapshots OpenWrt repositories before the end of the week hopefully.

I can't reproduce this so I can't figure out what's going on to fix. :frowning:

1 Like

Yeah, every time hitting "Save and Apply" on Luci, even without changing anything. And there is just the default on the Allowed list
image
image

Then a reload from CLI and refresh page and its ok, so just a cosmetic issue lol

p.s also Stop/Start service from Luci clears the message