Adblock-oisd : 22.03 allows you to use huge blocklists with dnsmasq

I have tested the script, forking its repository and changing the URL https://dnsmasq2.oisd.nl to https://small.oisd.nl/dnsmasq2 and I don't see that it is blocking ads.

Log entries?

Possibly oisd small isn't meeting the minimum line count or another check. May need to adjust the script to account for this

1 Like
Thu Mar  2 21:27:29 2023 user.notice adblock-oisd: Started adblock-oisd.
Thu Mar  2 21:27:29 2023 user.notice adblock-oisd: Downloading new oisd.txt.
Thu Mar  2 21:27:34 2023 user.notice adblock-oisd: Download of new oisd.txt file suceeded.
Thu Mar  2 21:27:34 2023 user.notice adblock-oisd: Checking new oisd.txt.
Thu Mar  2 21:27:41 2023 user.notice adblock-oisd: Good line count: 72150 below 100,000.
Thu Mar  2 21:27:41 2023 user.notice adblock-oisd: New oisd.txt file check failed.

It would be nice if you could choose the list of domains.

Ah so yes the log explains it. One of the checks with the normal oisd file is that the line count is greater than 100k. Your count was less and so the check failed and the oisd file was not installed. We can make this a parameter too, just like the URL. So then the user can set URL and minimum line count.

What do you mean by choosing the list of domains? Do you mean to give some preconfigured options like oisd small, oisd big, etc? If so that seems reasonable.

Can anyone confirm the present status of the oisd lists? I believe this: https://dnsmasq2.oisd.nl is still working right?

Yes, I mean that.

On the oisd site, you can see the correct URLs.

1 Like

I've generalized out to accept other blocklists that follow the dnsmasq format - see here:

Anyone see any issues? If all is well then I will pull this into main and following some testing create a new thread in the community projects section.

He changed it again. It is now:

https://big.oisd.nl/dnsmasq2
and
https://raw.githubusercontent.com/sjhgvr/oisd/main/dnsmasq2_big.txt

For the full list v2.86 and above

2 Likes

Thanks! I updated the URL.

@Wizballs, and anyone else already using or interested in trying this very lean but effective adblock service script, please could you test:

How do I use the small domain list?

Just change 'big' to 'small' and reduce the minimum line count to an appropriate value here:

The minimum line count should reflect the minimum number of lines you expect to see in the blocklist. Any count below this value will result in rejection of the blocklist.

1 Like

Does it work? Please let us know how you get on!

Thu Mar 23 02:43:40 2023 user.notice adblock-lean: Started adblock-lean.
Thu Mar 23 02:43:40 2023 user.notice adblock-lean: Downloading new blocklist file.
Thu Mar 23 02:43:41 2023 user.notice adblock-lean: Download of new blocklist file suceeded.
Thu Mar 23 02:43:41 2023 user.notice adblock-lean: Checking new blocklist file.
Thu Mar 23 02:43:46 2023 user.notice adblock-lean: Good line count: 50918 below 100,000.
Thu Mar 23 02:43:46 2023 user.notice adblock-lean: New blocklist file check failed.

Changed and Restarted the script (twice).

#!/bin/sh /etc/rc.common

# adblock-lean blocks ads using the highly popular oisd dnsmasq file and
# offers a leaner solution to adblocking than the existing alternatives on OpenWrt

# Project homepage: https://github.com/lynxthecat/adblock-lean

# Authors: @Lynx and @Wizballs (OpenWrt forum)

# *** CONFIGURATION OPTIONS ***

blocklist_url="https://small.oisd.nl/dnsmasq2"
min_good_line_count=100000
max_blocklist_file_size_KB=20000

# *** DO NOT EDIT BELOW THIS LINE ***

export PATH=/usr/sbin:/usr/bin:/sbin:/bin
export HOME=/root

START=99
STOP=4

Changed it back to "Big", and I'm back to a good config.

Thu Mar 23 02:48:37 2023 user.notice adblock-lean: The dnsmasq check passed with new blocklist file.
Thu Mar 23 02:48:37 2023 user.notice adblock-lean: New blocklist installed with good line count: 293209.

So I think that's by design. The min_good_line_count is the minimum number of block lines that the blocklist downloaded from the blocklist_url must have. @Wizballs and I set this up to skip over installing new blocklist files that are unexpectedly short. We have various further safety checks too like safeguarding against unsafe redirects and verifying that once the blocklist has been installed major websites can still be accessed.

From your log there it seemed that you changed the blocklist_url to point to the small list, which got successfully downloaded, but the check to verify that the min_good_line_count was satisfied failed because the downloaded small blocklist had less than 100,000 good lines; the downloaded blocklist had 50918 good lines.

So for the small blocklist probably a good min_good_line_count would be 25,000 rather than the default 100,000.

3 Likes

Just to be clear, there was noting in the /tmp/dnsmasq.d dir using small.

Yes so if a downloaded blocklist is rejected for one reason or another it won't get installed. I think if you were to rerun with that same URL for the small list but with min_good_line_count reduced to 25,000 it would install and go with that. I'd be curious if that actually seems to block most ads or whether it's noticeably less effective in terms of blocking major ads than the big list, which I use all the time.

1 Like

I used the small blocklist before dnsmasq 2.86 came along and allowed the big list to run fast. Even small on 2.85 I could notice some micro-lagging and higher CPU use.

With small some ads get through, but they are definitely reduced vs running nothing.

03/23/2023  04:04 AM         8,379,844 blocklist
03/23/2023  04:02 AM         1,311,255 blocklist_sm
03/23/2023  04:10 AM                 0 oisd.txt

No throughal test to see what was blocked, just looked at the one app on phone to confirm small is as good a big for WunderGround.

...Edit
tested down from 100000 > 75000 > 55000 > 25000
all failed until 25000

Well that makes sense, lynx said above that small has 50k lines, so any number higher than that will fail

1 Like