RFC 8109
Initializing a DNS Resolver with Priming Queries
RFC 8109 π Initializing a DNS Resolver with Priming Queries β¨
Okay bestie, let's get into it π This one is BCP 209, which means it's a Best Current Practice π§. It was published in March 2017 and it's part of the ISSN: 2070-1721 stream. The authors are P. Koch from DENIC eG, M. Larson, and P. Hoffman from ICANN πΈ. It is not an update to anything and it doesn't obsolete anything either, so it's a clean slate π«Ά.
Abstract
This document describes the queries that a DNS resolver should emit to initialize its cache π . The result is that the resolver gets both a current NS Resource Record Set (RRset) for the root zone and the necessary address information for reaching the root servers π¦.
Status of This Memo
This memo documents an Internet Best Current Practice π.
This document is a product of the Internet Engineering Task Force (IETF) π. It represents the consensus of the IETF community β¨. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG) π. Further info on BCPs is in Section 2 of RFC 7841 π.
Info about the current status of this document, any errata, and how to give feedback on it can be found at http://www.rfc-editor.org/info/rfc8109 π§.
Copyright Notice
Copyright (c) 2017 IETF Trust and the persons identified as the document authors π . All rights reserved π.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they were on the date this document was published πΈ. Please review these documents carefully, because they describe your rights and restrictions with respect to this document π«Ά. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they are provided without warranty as described in the Simplified BSD License π.
1. Introduction π
Okay so, recursive DNS resolvers need a starting point to resolve queries πΈ. [RFC1034] describes a common scenario for recursive resolvers: they begin with an empty cache and some configuration for finding the names and addresses of the DNS root servers β¨. That configuration is described in [RFC1034] as a list of servers that will give authoritative answers to queries about the root π¦. This has become a super common implementation choice for recursive resolvers, and that's the topic of this document π .
This document describes the steps needed for this common implementation choice π§. Note that this is not the only way to start a recursive name server with an empty cache π, but it is the only one described in [RFC1034] π. Some implementers have chosen other directions, and some of those work well while others fail (sometimes disastrously) under different conditions π. For example, an implementation that only gets the addresses of the root name servers from configuration, not from the DNS as described in this document, will have stale data that could cause slower resolution π’.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119] π.
This document only deals with recursive name servers (recursive resolvers, resolvers) for the IN class π.
2. Description of Priming π
Priming is the act of finding the list of root servers from a configuration that lists some or all of the purported IP addresses of some or all of those root servers β¨. A recursive resolver starts with no information about the root servers, and ends up with a list of their names and their addresses π¦.
Priming is described in Sections 5.3.2 and 5.3.3 of [RFC1034] π. The scenario used in that description, the one where a recursive server is also authoritative, is no longer as common π.
The configured list of IP addresses for the root servers usually comes from the vendor or distributor of the recursive server software π§. This list is usually correct and complete when shipped, but it may become out of date over time π.
The list of root server operators and the domain name associated with each one has been stable since 1997 π. However, there are address changes for the root server domain names, both for IPv4 and IPv6 addresses π. However, research shows that after those addresses change, some resolvers never get the new addresses π . Therefore, it is important that resolvers be able to cope with change, even without relying upon configuration updates being applied by their operator π«Ά. Root server change is the main reason that resolvers need to do priming instead of just going from a configured list to get a full and accurate list of root servers πΈ.
3. Priming Queries π¦
A priming query is a DNS query used to get the root server information in a resolver π. It has a QNAME of "." and a QTYPE of NS, and it is sent to one of the addresses in the configuration for the recursive resolver π. The priming query can be sent over either UDP or TCP π§. If the query is sent over UDP, the source port SHOULD be randomly selected (see [RFC5452]) π. The Recursion Desired (RD) bit MAY be set to 0 or 1, although the meaning of it being set to 1 is undefined for priming queries π.
The recursive resolver SHOULD use EDNS(0) [RFC6891] for priming queries π and SHOULD announce and handle a reassembly size of at least 1024 octets [RFC3226] β¨. Doing so allows responses that cover the size of a full priming response (see Section 4.2) for the current set of root servers π. See Section 3.3 for discussion of setting the DNSSEC OK (DO) bit (defined in [RFC4033]) π«Ά.
3.1. Repeating Priming Queries πΈ
The recursive resolver SHOULD send a priming query only when it is needed, such as when the resolver starts with an empty cache and when the NS RRset for the root zone has expired π¦. Because the NS records for the root are not special, the recursive resolver expires those NS records according to their TTL values π. (Note that a recursive resolver MAY pre-fetch the NS RRset before it expires π§.)
If a priming query does not get a response, the recursive resolver needs to retry the query with a different target address from the configuration π.
3.2. Target Selection π
In order to spread the load across all the root server domain names, the recursive resolver SHOULD select the target for a priming query randomly from the list of addresses π. The recursive resolver might choose either IPv4 or IPv6 addresses based on its knowledge of whether the system on which it is running has adequate connectivity on either type of address π.
Note that this recommended method is not the only way to choose from the list in a recursive resolver's configuration π. Two other common methods include picking the first from the list, and remembering which address in the list gave the fastest response earlier and using that one π . There are probably other methods in use today β¨. However, the random method listed above SHOULD be used for priming π.
3.3. DNSSEC with Priming Queries π«Ά
The resolver MAY set the DNSSEC OK (DO) bit π. At the time of publication, there is little use to performing DNSSEC validation on the priming query πΈ. Currently, all root name server names end in "root-servers.net" and the AAAA and A RRsets for the root server names reside in the "root-servers.net" zone π¦. All root servers are also authoritative for this zone, allowing priming responses to include the appropriate root name server A and AAAA RRsets π. But, because the "root-servers.net" zone is not currently signed, these RRsets cannot be validated π.
A man-in-the-middle attack on the priming query could direct a resolver to a rogue root name server π. Note, however, that a validating resolver will not accept responses from rogue root name servers if they are different from the real responses, because the resolver has a trust anchor for the root and the answers from the root are signed π‘οΈ. Thus, if there is a man-in-the-middle attack on the priming query, the only result for a validating resolver will be a denial of service, not the resolver accepting the bad responses π.
If the "root-servers.net" zone is later signed, or if the root servers are named in a different zone and that zone is signed, having DNSSEC validation for the priming queries might be valuable π§.
4. Priming Responses β¨
A priming query is a normal DNS query π. Thus, a root name server cannot distinguish a priming query from any other query for the root NS RRset π. Thus, the root server's response will also be a normal DNS response π¦.
4.1. Expected Properties of the Priming Response π
The priming response is expected to have an RCODE of NOERROR, and to have the Authoritative Answer (AA) bit set π. Also, it is expected to have an NS RRset in the Answer section (because the NS RRset originates from the root zone), and an empty Authority section (because the NS RRset already appears in the Answer section) πΈ. There will also be an Additional section with A and/or AAAA RRsets for the root name servers pointed at by the NS RRset π.
Resolver software SHOULD treat the response to the priming query as a normal DNS response, just as it would use any other data fed to its cache π«Ά. Resolver software SHOULD NOT expect exactly 13 NS RRs because, historically, some root servers have returned fewer π.
4.2. Completeness of the Response π§
There are currently 13 root servers π¦. All have one IPv4 address and one IPv6 address π . Not even counting the NS RRset, the combined size of all the A and AAAA RRsets exceeds the original 512-octet payload limit from [RFC1035] π.
In the event of a response where the Additional section omits certain root server address information, re-issuing the priming query does not help with those root name servers that respond with a fixed order of addresses in the Additional section π. Instead, the recursive resolver needs to issue direct queries for A and AAAA RRsets for the remaining names π. Currently, these RRsets would be authoritatively available from the root name servers β¨.
Part 1 of 2 done, bestie! π Part 2 is coming with Security Considerations, IANA stuff, references, and the Acknowledgements/Authors' Addresses, so stay tuned πβ¨
5. Security Considerations π₯
okay this is the spicy part bestie π«£ spoofing a response to a priming query can be used to redirect ALL the queries coming from a victim recursive resolver over to one or more servers the attacker controls π and until those priming responses are protected with DNSSEC, there's no definitive way to stop it. no cap, that's a whole lot of π
so an on-path attacker can watch a priming query leave a resolver and inject false answers before a root server gets a chance to reply with the correct ones πββοΈπ¨ if the resolver accepts the fake answers, the attacker can keep handing out false answers for future queries too. main villain origin story, fr π¦ΉββοΈ
false answers for the root servers are way more dangerous than, say, false answers for Top-Level Domains (TLDs), because the root is the highest node of the DNS π it's literally the top of the whole tree, so messing with it hits differently. see Section 3.3 for more tea on this π΅
in both of the scenarios above, a validating resolver can catch the attack IF its chain of queries reaches a zone that is signed π‘οΈβ¨ but for unsigned zones? it can't detect it. π₯Ί so signed zones are the ones with the bodyguards, unsigned ones are kinda on their own rn π«Ά
6. IANA Considerations πΈ
this one's a chill girl era π§ββοΈ this document does not require any IANA actions. nothing to register, nothing to update, we're literally just vibing π
7. Normative References π
these are the sources the whole doc leans on, so here they are in full, no skipping π«Ά
[RFC1034] Mockapetris, P., "Domain names - concepts and
facilities", STD 13, RFC 1034, DOI 10.17487/RFC1034,
November 1987, <http://www.rfc-editor.org/info/rfc1034>.
[RFC1035] Mockapetris, P., "Domain names - implementation and
specification", STD 13, RFC 1035, DOI 10.17487/RFC1035,
November 1987, <http://www.rfc-editor.org/info/rfc1035>.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997,
<http://www.rfc-editor.org/info/rfc2119>.
[RFC3226] Gudmundsson, O., "DNSSEC and IPv6 A6 aware
server/resolver message size requirements", RFC 3226,
DOI 10.17487/RFC3226, December 2001,
<http://www.rfc-editor.org/info/rfc3226>.
[RFC4033] Arends, R., Austein, R., Larson, M., Massey, D., and S.
Rose, "DNS Security Introduction and Requirements",
RFC 4033, DOI 10.17487/RFC4033, March 2005,
<http://www.rfc-editor.org/info/rfc4033>.
[RFC5452] Hubert, A. and R. van Mook, "Measures for Making DNS More
Resilient against Forged Answers", RFC 5452,
DOI 10.17487/RFC5452, January 2009,
<http://www.rfc-editor.org/info/rfc5452>.
[RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms
for DNS (EDNS(0))", STD 75, RFC 6891,
DOI 10.17487/RFC6891, April 2013,
<http://www.rfc-editor.org/info/rfc6891>.
Acknowledgements π
this doc is the product of the DNSOP WG and it benefitted from the reviews done there π the DNSOP crew really came through, iconic behaviour π
Authors' Addresses π
the people who wrote this, with their contact details exactly as listed π¦
Peter Koch
DENIC eG
Kaiserstrasse 75-77
Frankfurt 60329
Germany
Phone: +49 69 27235 0
Email: pk@DENIC.DE
Matt Larson
ICANN
Email: matt.larson@icann.org
Paul Hoffman
ICANN
Email: paul.hoffman@icann.org
π¦ where this page comes from
- ietf: rfc8109 2017-03
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms