Repository navigation
DNS ad blocking with dnsmasq lists, no new process (#30) - #79
Merged
Merged
Conversation
Off by default. `mr dns adblock update` downloads the lists (https only; plain domains, hosts, adblock ||name^ or dnsmasq lines), keeps valid names, folds names under another listed name, removes allowed ones (never the lists' hosts, the NTP servers, the local domain) and writes one `local=/name/` per domain; both dnsmasq instances load it with conf-file=. - Never worse: a failed, oversized or non-domain list (an HTML error page) keeps the previous file, so does a result above max_domains; a dnsmasq that does not come back gets the previous file. - crond hourly; --cron downloads when the file is 20 h old or the settings changed, never while a change waits for confirmation. - CLI `mr dns adblock status | update`, API dns.adblock, web UI 网络 › DNS › 去广告. Tests and CI with a local HTTPS server and the real dnsmasq (150k names: answering 232 ms after start, RSS 18.6 MB on x86_64). Docs: docs/modules/dns.md. Closes #30 Claude-Session: https://claude.ai/code/session_01HWeUjo1dmS7gBkCYHrVjCr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
dns.adblock, off by default. No new process: blocklists become dnsmasqlocal=/name/lines that both dnsmasq instances (main and proxy) load.mr dns adblock update||name^, dnsmasq lines. Element-hiding rules, exceptions andserver=/x/#lines are not treated as names.allow.server=/name/#).max_domains(default 300000).--crononly downloads when the file is 20 h old or was built from other settings. So switching it on, or a failed update, is retried within the hour.mr dns adblock status | update; APIdns.adblock(token scope operate); web UI 网络 › DNS › 去广告, with presets HaGeZi Multi NORMAL / LIGHT and anti-AD.Why
Ad blocking is a common ask. AdGuard Home is about 34 MiB and gets OOM-killed with large lists; dnsmasq ≥ 2.86 handles large
local=sets compactly.Verification
allow, validation, render (the empty file is written only when none exists), the cron line;tools/ci.d/dns.sh:sh tools/ci.sh: ALL CHECKS PASSED.Closes #30
https://claude.ai/code/session_01HWeUjo1dmS7gBkCYHrVjCr