Repository navigation
Keep other zones' records out of the additional section - #411
Merged
Merged
Conversation
additional_processing/3 looked up each NS and MX target in the whole zone cache, so an answer carried the A and AAAA records of whichever zone held the target's name. On a server that hosts zones for many parties, whoever could add a zone for the name of another zone's nameserver or mail exchanger had their records sent along with that zone's answers, NS answers and referrals included. Resolvers drop them as out of bailiwick (RFC 5452 §6), but the server still sent them. Only targets at or below the apex of the zone that answers are looked up now, the rule follow/5 already applies to CNAME targets. Glue, and the records of a zone hosted below this one, still come through. A zone whose nameservers are named in another domain now answers NS with an empty additional section. dnstest's dnssec_ns expected example.com's records for the nameservers of minimal-dnssec.com: the test profile now pins a dnstest commit that expects none. The new resolver_SUITE case covers NS answers, MX answers and referrals, and failed before this change. make test passes.
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.
erldns filled the additional section by looking up every NS and MX target in the whole zone cache, so a zone's answers carried the A and AAAA records of whichever zone held the names of its nameservers and mail exchangers. On a server that hosts zones for many parties, anyone who can add a zone for such a name gets their addresses sent along with someone else's answers, NS answers and referrals included. BIND, Unbound, PowerDNS Recursor and Knot Resolver all drop these records as out of bailiwick (RFC 5452 §6), so for them this was not a way into the cache, but there is no reason to send them.
Now only targets at or below the apex of the zone that answers get their addresses, the rule the resolver already applies when it follows a CNAME. Glue in referrals, and the records of a zone hosted below the apex, still come through: the section holds what a resolver would accept from it.
A zone whose nameservers are named in another domain, such as any zone served under a provider's own nameserver names, now answers NS with an empty additional section. Resolvers were discarding those records already and resolve the nameservers through their own zones, so nothing changes for them, and the responses get smaller.
dnstest's
dnssec_nsexpectedexample.com's records in the NS answer ofminimal-dnssec.com. dnsimple/dnstest#53 dropped them, and the test profile here pins its merge commit. No other dnstest definition changed, and none of the PowerDNS regression tests expects addresses from outside the answering zone.additional_holds_only_names_under_the_apexinresolver_SUITEcovers NS answers, MX answers and referrals with a second zone in the cache, and fails onmain.make testpasses.🔍 QA
Scenario: NS answer for a zone whose nameservers are in another zone
rebar3 ct --suite test/dnstest_SUITEonce, so that the dnstest zones are in_build/test/lib/dnstest/priv/.erldns.example.config, set the zonespathto"_build/test/lib/dnstest/priv/", and start a node withrebar3 as test shell --config <the copy>.dig +norec @127.0.0.1 -p 8053 minimal-dnssec.com NSanswers withns1.example.comandns2.example.comand no A or AAAA records in the additional section. Onmainit carriesexample.com's records for both.dig +norec @127.0.0.1 -p 8053 example.com NSstill carries the A and AAAA records ofns1.example.comandns2.example.com, which are in the zone.📋 Deployment Pre/Post tasks
mix deps.update dnstest: its integration suite runsdnssec_ns, andmix.lockholds dnstest at9bfb1c1.dig +norec @ns1.dnsimple-edge.com dnsimple.com NSreturns no A or AAAA records for thednsimple-edge.*nameservers in the additional section.