Repository navigation
dns: dnsmasq, mr-proxy-dns and mr-parental-dns listen on the LAN bridges and 127.0.0.1 / ::1 only, not on every address of lo (Closes #178) - #179
Merged
Conversation
…ges and 127.0.0.1 / ::1 only, not on every address of lo (Closes #178) An interface= line makes dnsmasq add all of lo, and bind-dynamic opens a UDP and a TCP socket per address on it. Hundreds of /128 source addresses on lo (ss-nodes, doubled while the ISP's prefix changes) used up the 1024 descriptors of all three instances: no DNS, `mr proxy check` failing, the migration that would drop the old addresses never finishing. They now render `except-interface=lo` + `listen-address=127.0.0.1` + `listen-address=::1` and keep bind-dynamic for the bridges. Tests: TestDnsmasqListensOnBridgesAndLoopbackOnly, TestDNSHomeDnsmasqUnchanged (new lines), ci.d/dns.sh and ci.d/proxy.sh (1000 extra /128 on lo, < 100 descriptors), lab scenario 16-dnsmasq-listen-scope. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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
The main dnsmasq,
mr-proxy-dnsandmr-parental-dnsnow render(one shared constant,
dnsmasqListenLinesinmod_dns.go). They listen on the LAN bridges,127.0.0.1and::1, and on no other address oflo.Why
dnsmasq adds all of
loas soon as there is aninterface=line, andbind-dynamicopens a UDP and a TCP socket for every address on it. An add-on that keeps hundreds of/128source addresses onlo(twice as many while the ISP's prefix changes) ran all three instances into their 1024-descriptor limit: no DNS,mr proxy checkfailing, and so the migration that would drop the old addresses never finished. Closes #178.listen-addressoverridesexcept-interfacefor the address it names (checked with dnsmasq 2.91 on the build host and 2.92 in the lab), so 127.0.0.1 / ::1 stay.bind-dynamicstays, so the bridges' addresses still follow the delegated prefix. Nothing else changes:dns.redirect, the proxy's and parental's nft redirects (they redirect to the bridge address), RDNSS (router's bridge address), DHCP (interface=),local-service, rebind protection and/etc/resolv.conf(127.0.0.1) are as before.Verification
TestDnsmasqListensOnBridgesAndLoopbackOnly(all three configs, two bridges:interface=lines are exactly the bridges,except-interface=lo,listen-address=exactly 127.0.0.1 and ::1, nobind-interfaces),TestDNSHomeDnsmasqUnchangedupdated.TestIPv6RelayDisabledMatchesMainBaselineFilespins a hash of the homednsmasq.conf; I updated that hash for the three new lines (the old one was theorigin/mainbaseline of that config).tools/ci.d/dns.sh: the rendered lab dnsmasq runs for real with 1000 extra/128onlo: 24 descriptors, listens on 127.0.0.1:53.tools/ci.d/proxy.sh: same for the renderedproxy-dns.confand the main stand-in (15 and 22 descriptors).16-dnsmasq-listen-scope(new, lab id 8): PPPoE + DHCPv6-PD router with proxy, parental control anddns.redirect; three LAN clients (parental, proxied, bypass). 1000/128onlounder running dnsmasq, again after restarting all three, again after removing them: descriptors stay 21 / 18 / 17 (main / proxy / parental) in every phase; IPv4 and IPv6 DNS, redirect of port 53, safe search, blocklist, fake-ip answers, rebind protection, the router's own resolver (127.0.0.1 and ::1),mr proxy check, DHCP and abr-lanaddress added later (bind-dynamic) all pass: 103/103 ok.origin/main(before the fix): 1024 descriptors in all three instances once the addresses are onlo, DNS down for every client, and no dnsmasq process was left 3 s after restarting them with the addresses present, nor after the addresses were removed again (41 ok / 62 not ok).sh tools/ci.sh: ALL CHECKS PASSED.🤖 Generated with Claude Code