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

Also saw it over on Reddit, thanks for sharing here.

Just sharing what I've configured in Startup (above the exit 0 line):

mkdir -p /tmp/dnsmasq.d && wget https://dnsmasq.oisd.nl -O /tmp/oisd.txt && mv /tmp/oisd.txt /tmp/dnsmasq.d/oisd.txt && /etc/init.d/dnsmasq restart

And Scheduled Tasks (below line runs every day at 5:00am):

0 5 * * * mkdir -p /tmp/dnsmasq.d && wget https://dnsmasq.oisd.nl -O /tmp/oisd.txt && mv /tmp/oisd.txt /tmp/dnsmasq.d/oisd.txt && /etc/init.d/dnsmasq restart

Details:

mkdir -p /tmp/dnsmasq.d ensures the folder exists

wget https://dnsmasq.oisd.nl -O /tmp/oisd.txt downloads the list to /tmp/oisd.txt (a temporary file)

mv /tmp/oisd.txt /tmp/dnsmasq.d/oisd.txt moves the temporary file to the actual location. This is so that if the wget download fails it doesn't load an empty file. If the download failed, this command will fail as there won't be any /tmp/oisd.txt file to move.

/etc/init.d/dnsmasq restart restarts the dnsmasq service with the updated list

And for those who aren't familiar, anything in the /tmp directory is stored on RAM (not non-volatile storage), which is good for the longevity of the device.

I've paired the above with this firewall rule to force all devices' plain 53 connections to be filtered: https://openwrt.org/docs/guide-user/firewall/fw3_configurations/intercept_dns

7 Likes