RFC 9156
DNS Query Name Minimisation to Improve Privacy
RFC 9156: DNS Query Name Minimisation to Improve Privacy π
Okay bestie, this one is from the IETF and it's a Standards Track document π It was published in November 2021 and the ISSN is 2070-1721. The authors are S. Bortzmeyer (AFNIC), R. Dolmans (NLnet Labs), and P. Hoffman (ICANN) π§ It obsoletes RFC 7816, and there's no Updates line in the header, so it doesn't update anything listed there πΈ
Abstract β¨
This doc describes a technique called "QNAME minimisation" to improve DNS privacy π With it, the DNS resolver doesn't always send the full original QNAME and original QTYPE to the upstream name server anymore π It also says this document obsoletes RFC 7816 π
Status of This Memo π
This is an Internet Standards Track document.
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 information on Internet Standards is available in Section 2 of RFC 7841.
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc9156.
Copyright Notice Β©οΈ
Copyright (c) 2021 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 (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.
Table of Contents πΊοΈ
1. Introduction and Background
1.1. Experience from RFC 7816
1.2. Terminology
2. Description of QNAME Minimisation
2.1. QTYPE Selection
2.2. QNAME Selection
2.3. Limitation of the Number of Queries
2.4. Implementation by Stub and Forwarding Resolvers
3. Algorithm to Perform QNAME Minimisation
4. QNAME Minimisation Examples
5. Performance Considerations
6. Security Considerations
7. References
7.1. Normative References
7.2. Informative References
Acknowledgments
Authors' Addresses
1. Introduction and Background π¦
The problem statement for this doc lives in [RFC9076] π This specific solution is not meant to fully solve the DNS privacy problem. It's more like one tool amongst many π§°
QNAME minimisation follows the principle explained in Section 6.1 of [RFC6973], which is basically: the less data you send out, the fewer privacy problems you have π Iconic, honestly π
Before QNAME minimisation, if a resolver got the query "What is the AAAA record for www.example.com?", it sent the very same question to the root (assuming a resolver with an empty cache) π Sending the full QNAME to the authoritative name server was a tradition, not a protocol requirement β¨ In a conversation with one of the authors in January 2015, Paul Mockapetris explained that this tradition came from a desire to optimise the number of requests. This applied when the same name server was authoritative for many zones in a given name, which was more common in the old days when the same name servers served .com and the root, or when the same name server was both recursive and authoritative, which is strongly discouraged now π Whatever the merits of that choice at the time, the DNS is quite different now π
QNAME minimisation is compatible with the current DNS system, so it can easily be deployed π Because it's only a change to the way the resolver operates, it doesn't change the DNS protocol itself π«Ά The behaviour suggested here, minimising the amount of data sent in QNAMEs from the resolver, is allowed by Section 5.3.3 of [RFC1034] and Section 7.2 of [RFC1035] π
1.1. Experience from RFC 7816
This document obsoletes [RFC7816]. [RFC7816] was categorised "Experimental", but ideas from it were widely deployed after it was published πΈ Many resolver implementations now support QNAME minimisation π The lessons learned from implementing it were used to create this new revision π
Data from DNSThought [dnsthought-qnamemin], Verisign [verisign-qnamemin], and APNIC [apnic-qnamemin] shows that a large percentage of the resolvers deployed on the Internet already support QNAME minimisation in some way π
Academic research has been done on QNAME minimisation [devries-qnamemin] π That work shows that QNAME minimisation in relaxed mode causes almost no problems π₯³ The paper recommends using the A QTYPE and limiting the number of queries in some way π Some of the issues the paper found are covered in Section 5 π
1.2. Terminology
The terminology used in this document is defined in [RFC8499] π
In this document, a "cold" cache is one that is empty, having literally no entries in it π₯Ά A "warm" cache is one that has some entries in it π₯
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here π
2. Description of QNAME Minimisation π
The idea behind QNAME minimisation is to minimise the amount of privacy-sensitive data sent from the DNS resolver to the authoritative name server π‘οΈ This section explains how to do it, and the algorithm is summarised in Section 3 π§
When a resolver can't answer a query from its cache, it has to send a query to an authoritative name server π¨ Traditionally, these queries would contain the full QNAME and the original QTYPE as received in the client query π¬
The full QNAME and original QTYPE are only needed at the name server that is authoritative for the record the client asked for β¨ All the other name servers queried while resolving the query only need to receive enough of the QNAME to answer with a delegation π€ The QTYPE in these queries doesn't matter, because that name server can't authoritatively answer the records the client is looking for π ββοΈ So sending the full QNAME and original QTYPE to these name servers exposes more privacy-sensitive data than necessary to resolve the client's request π«£
A resolver that implements QNAME minimisation obscures the QNAME and QTYPE in queries sent to an authoritative name server that is not known to be responsible for the original QNAME π΅οΈββοΈ These queries contain:
- a QTYPE selected by the resolver to possibly obscure the original QTYPE
- the QNAME that is the original QNAME, stripped to just one label more than the longest matching domain name for which the name server is known to be authoritative
2.1. QTYPE Selection
Note that this document relaxes the recommendation in [RFC7816] to use the NS QTYPE to hide the original QTYPE π Using the NS QTYPE is still allowed. The authority of NS records lies at the child side. The parent side of the delegation will answer using a referral, like it will do for queries with other QTYPEs. So using the NS QTYPE has no added value over other QTYPEs π€·ββοΈ
The QTYPE to use while minimising queries can be any possible data type (as defined in Section 3.1 of [RFC6895]) for which the authority always lies below the zone cut (i.e., not DS, NSEC, NSEC3, OPT, TSIG, TKEY, ANY, MAILA, MAILB, AXFR, and IXFR), as long as there is no relation between the incoming QTYPE and the selection of the QTYPE to use while minimising π― The A or AAAA QTYPEs are always good candidates, because they're the least likely to raise issues in DNS software and middleboxes that don't properly support all QTYPEs π QTYPE=A or QTYPE=AAAA queries also blend into traffic from nonminimising resolvers, which in some cases makes it harder to notice that the resolver is using QNAME minimisation π₯· Using a QTYPE that occurs most often in incoming queries will slightly reduce the number of queries, since there's no extra check needed for delegations on non-apex records π§
2.2. QNAME Selection
The minimising resolver works perfectly when it knows the zone cut (zone cuts are described in Section 6 of [RFC2181]) π§© But zone cuts don't necessarily exist at every label boundary π In the name www.foo.bar.example, there might be a zone cut between "foo" and "bar" but not between "bar" and "example" π€ So, assuming the resolver already knows the name servers of example, when it gets the query "What is the AAAA record of www.foo.bar.example?", it doesn't always know where the zone cut will be π΅βπ« To find it, it will query the example name servers for a record for bar.example. It will get a non-referral answer, so it has to query the example name servers again with one more label, and so on π (Section 3 describes this algorithm in deeper detail π)
π That's the first chunk, bestie! More parts are coming, so stay tuned π
2.3. Limitation of the Number of Queries
Okay so this section is where things get spicy πΆοΈπ . When you do QNAME minimisation, the number of labels in the incoming QNAME can change how many queries your resolver sends out. That opens an attack vector and can tank performance, bestie π. So resolvers that support QNAME minimisation MUST implement a mechanism to limit the number of outgoing queries per user request. No skipping this one, periodt π«Ά.
Let's look at an example. Say you get a QNAME with a bunch of labels, like www.host.group.department.example.com, where host.group.department.example.com is hosted on example.com's name servers. (Deep domains like this are super common under ip6.arpa, it's giving very deep π.) Imagine a resolver that only knows the name servers of example.com. Without QNAME minimisation, it would ask those servers for www.host.group.department.example.com and immediately get a specific referral or an answer, no extra probing needed β¨. With QNAME minimisation, a cold resolver sends more queries, one per label π§. Once the cache is warm, the difference with a traditional resolver gets smaller π¦. Testing of this is described in [Huque-QNAME-Min].
Now the sneaky part π. The attacker can send queries with a huge number of labels in the QNAME that get answered by a wildcard record. Say there's a record for *.example.com hosted on example.com's name servers. An incoming query with more than 100 labels, ending in example.com, will result in one query per label. The attacker uses random labels so the cache gets bypassed, and your resolver has to keep sending a ton of queries upstream π. Note that [RFC8198] can limit this attack in some cases π.
One mechanism that MAY be used to reduce this attack vector is appending more than one label per iteration for QNAMEs with lots of labels π. To do this, you MUST select a maximum number of QNAME minimisation iterations (MAX_MINIMISE_COUNT). A RECOMMENDED value is 10 π. You can also optionally select a value for the number of queries that should only have one label appended (MINIMISE_ONE_LAB) π. A good value is 4. The assumption here is that the number of labels on delegations higher up in the hierarchy are pretty small, so not exposing too many labels early on gives the most privacy benefit π₯.
Another potential, optional mechanism for limiting the number of queries is to assume that labels beginning with an underscore (_) do not represent privacy-relevant administrative boundaries πΈ. For example, if the QNAME is "_25._tcp.mail.example.org" and the algorithm has already searched for "mail.example.org", the next query can be for all the underscore-prefixed names together, namely "_25._tcp.mail.example.org" π«§.
When a resolver needs to send out a query, it looks for the closest-known delegation point in its cache π. The number of not-yet-exposed labels is the difference between this closest name server and the incoming QNAME. The first MINIMISE_ONE_LAB labels are handled as described in Section 2. The labels that are still not exposed then need to be divided proportionally over the remaining iterations (MAX_MINIMISE_COUNT - MINIMISE_ONE_LAB). If the not-yet-exposed labels can't be divided equally over the remaining iterations, the remainder of the division SHOULD be added to the last iterations π§. For example, when resolving a QNAME with 18 labels with MAX_MINIMISE_COUNT set to 10 and MINIMISE_ONE_LAB set to 4, the number of labels added per iteration are: 1,1,1,1,2,2,2,2,3,3 β¨.
2.4. Implementation by Stub and Forwarding Resolvers
Stub and forwarding resolvers MAY implement QNAME minimisation π. Minimising queries sent to an upstream resolver doesn't hide data from that upstream resolver, because all the information ends up there anyway π. It might limit the data exposed between the upstream resolver and the authoritative name server, though, in the situation where the upstream resolver doesn't support QNAME minimisation π¦. Using QNAME minimisation in a stub or forwarding resolver that doesn't have a way to find and cache zone cuts will drastically increase the number of outgoing queries π. Not it, bestie π ββοΈ.
3. Algorithm to Perform QNAME Minimisation β¨
This algorithm does name resolution with QNAME minimisation when the zone cuts aren't known yet πΊοΈ.
Although a validating resolver already has the logic to find zone cuts, implementers of resolvers may want to use this algorithm to locate them anyway π.
(0) If the query can be answered from the cache, do so. Otherwise, iterate as follows:
(1) Get the closest delegation point that can be used for the original QNAME from the cache π .
(1a) For queries with a QTYPE for which the authority only lies at the parent side (like QTYPE=DS), this is the NS RRset with the owner matching the most labels with QNAME stripped by one label. QNAME will be a subdomain of (but not equal to) this NS RRset. Call this ANCESTOR.
(1b) For queries with other original QTYPEs, this is the NS RRset with the owner matching the most labels with QNAME. QNAME will be equal to or a subdomain of this NS RRset. Call this ANCESTOR.
(2) Initialise CHILD to the same as ANCESTOR π§.
(3) If CHILD is the same as QNAME, or if CHILD is one label shorter than QNAME and the original QTYPE can only be at the parent side (like QTYPE=DS), resolve the original query as normal, starting from ANCESTOR's name servers. Start over from step 0 if new names need to be resolved as a result of this answer, for example, when the answer contains a CNAME or DNAME [RFC6672] record π.
(4) Otherwise, update the value of CHILD by adding the next relevant label or labels from QNAME to the start of CHILD. The number of labels to add is discussed in Section 2.3 π.
(5) Look for a cache entry for the RRset at CHILD with the original QTYPE. If the cached response code is NXDOMAIN and the resolver has support for [RFC8020], the NXDOMAIN can be used in response to the original query, and stop. If the cached response code is NOERROR (including NODATA), go back to step 3. If the cached response code is NXDOMAIN and the resolver does not support [RFC8020], go back to step 3 π«Ά.
(6) Query for CHILD with the selected QTYPE using one of ANCESTOR's name servers. The response can be:
(6a) A referral. Cache the NS RRset from the authority section, and go back to step 1 π.
(6b) A DNAME response. Proceed as if a DNAME is received for the original query. Start over from step 0 to resolve the new name based on the DNAME target π¦.
(6c) All other NOERROR answers (including NODATA). Cache this answer. Regardless of the answered RRset type, including CNAMEs, continue with the algorithm from step 3 by building the original QNAME π.
(6d) An NXDOMAIN response. If the resolver supports [RFC8020], return an NXDOMAIN response to the original query, and stop. If the resolver does not support [RFC8020], go to step 3 π.
(6e) A timeout or response with another RCODE. The implementation MAY choose to retry step 6 with a different ANCESTOR name server πΈ.
4. QNAME Minimisation Examples π
As a first example, assume a resolver gets a request to resolve foo.bar.baz.example. Assume the resolver already knows that ns1.nic.example is authoritative for .example and that it doesn't know a more specific authoritative name server. It will send the query with QNAME=baz.example and the QTYPE selected to hide the original QTYPE to ns1.nic.example π΅οΈββοΈ.
+=======+=================+=========================+======+
| QTYPE | QNAME | TARGET | NOTE |
+=======+=================+=========================+======+
| MX | a.b.example.org | root name server | |
+-------+-----------------+-------------------------+------+
| MX | a.b.example.org | org name server | |
+-------+-----------------+-------------------------+------+
| MX | a.b.example.org | example.org name server | |
+-------+-----------------+-------------------------+------+
Table 1: Cold Cache, Traditional Resolution Algorithm
without QNAME Minimisation, Request for MX Record of
a.b.example.org
The following are more detailed examples of requests for an MX record of a.b.example.org with QNAME minimisation, using A QTYPE to hide the original QTYPE and using other names and authoritative servers π:
+=======+=================+=========================+============+
| QTYPE | QNAME | TARGET | NOTE |
+=======+=================+=========================+============+
| A | org | root name server | |
+-------+-----------------+-------------------------+------------+
| A | example.org | org name server | |
+-------+-----------------+-------------------------+------------+
| A | b.example.org | example.org name server | |
+-------+-----------------+-------------------------+------------+
| A | a.b.example.org | example.org name server | "a" may be |
| | | | delegated |
+-------+-----------------+-------------------------+------------+
| MX | a.b.example.org | example.org name server | |
+-------+-----------------+-------------------------+------------+
Table 2: Cold Cache with QNAME Minimisation
Note that, in the above example, one query would have been saved if the incoming QTYPE was the same as the QTYPE the resolver selected to hide the original QTYPE π€. Only one query for a.b.example.org would have been needed if the original QTYPE had been A. Using the most-used QTYPE to hide the original QTYPE therefore slightly reduces the number of outgoing queries compared to using any other QTYPE π β¨.
+=======+=================+=========================+============+
| QTYPE | QNAME | TARGET | NOTE |
+=======+=================+=========================+============+
| A | example.org | org name server | |
+-------+-----------------+-------------------------+------------+
| A | b.example.org | example.org name server | |
+-------+-----------------+-------------------------+------------+
| A | a.b.example.org | example.org name server | "a" may be |
| | | | delegated |
+-------+-----------------+-------------------------+------------+
| MX | a.b.example.org | example.org name server | |
+-------+-----------------+-------------------------+------------+
Table 3: Warm Cache with QNAME Minimisation
5. Performance Considerations β¨
Okay bestie, the big goal of QNAME minimisation is privacy π, aka sending way less data. But it also comes with some bonus perks π
. Imagine a resolver asks a root name server about A.example, then B.example, then C.example. That's three NXDOMAINs π, because .example isn't in the root zone at all π.
With QNAME minimisation, the resolver only asks about .example itself, and the root can answer NXDOMAIN to that one question. The resolver can cache that answer and use it to prove nothing below .example exists [RFC8020] πΈ. So it already knows, a priori, that neither B.example nor C.example exists. β¨ In this common case, the total number of upstream queries with QNAME minimisation can be counterintuitively less than with traditional iteration (as described in the DNS standard). Wild, right? π¦
QNAME minimisation can increase the number of queries based on the incoming QNAME. This is described in Section 2.3. As described in [devries-qnamemin], QNAME minimisation both increases the number of DNS lookups by up to 26% and leads to up to 5% more failed lookups. Not gonna lie, that's a real tradeoff π. Filling the cache in a production resolver will soften that overhead π«Ά.
6. Security Considerations π₯
Okay, this section is the serious one, so let's give it the attention it deserves π. QNAME minimisation's benefits are crystal clear when you want to decrease how much of the queried name the authoritative name server gets to see π. But minimising the amount of data sent also partly helps with the case of a wire sniffer π΅οΈββοΈ, as well as privacy invasion by the authoritative name servers.
Encryption is of course a better defense against wire sniffers π. But unlike QNAME minimisation, it changes the protocol and can't be deployed unilaterally π ββοΈ. Also, the effect of QNAME minimisation on wire sniffers depends on whether the sniffer is on the DNS path.
QNAME minimisation offers no protection against the recursive resolver. That resolver still sees the full request coming from the stub resolver π.
A resolver using QNAME minimisation can possibly be used to cause a query storm to be sent to servers when resolving queries containing a QNAME with a large number of labels, as described in Section 2.3 π¨. That section proposes methods to significantly dampen the effects of such attacks π‘οΈ.
7. References
7.1. Normative References
[RFC1034] Mockapetris, P., "Domain names - concepts and facilities",
STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987,
<https://www.rfc-editor.org/info/rfc1034>.
[RFC1035] Mockapetris, P., "Domain names - implementation and
specification", STD 13, RFC 1035, DOI 10.17487/RFC1035,
November 1987, <https://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,
<https://www.rfc-editor.org/info/rfc2119>.
[RFC6973] Cooper, A., Tschofenig, H., Aboba, B., Peterson, J.,
Morris, J., Hansen, M., and R. Smith, "Privacy
Considerations for Internet Protocols", RFC 6973,
DOI 10.17487/RFC6973, July 2013,
<https://www.rfc-editor.org/info/rfc6973>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC8499] Hoffman, P., Sullivan, A., and K. Fujiwara, "DNS
Terminology", BCP 219, RFC 8499, DOI 10.17487/RFC8499,
January 2019, <https://www.rfc-editor.org/info/rfc8499>.
7.2. Informative References
[apnic-qnamemin]
Huston, G. and J. Damas, "Measuring Query Name
Minimization", September 2020, <https://indico.dns-
oarc.net/event/34/contributions/787/
attachments/777/1326/2020-09-28-oarc33-qname-
minimisation.pdf>.
[devries-qnamemin]
de Vries, W., Scheitle, Q., MΓΌller, M., Toorop, W.,
Dolmans, R., and R. van Rijswijk-Deij, "A First Look at
QNAME Minimization in the Domain Name System", March 2019,
<https://nlnetlabs.nl/downloads/publications/
devries2019.pdf>.
[dnsthought-qnamemin]
"Qname Minimisation", October 2021,
<https://dnsthought.nlnetlabs.nl/#qnamemin>.
[Huque-QNAME-Min]
Huque, S., "Query name minimization and authoritative
server behavior", May 2015,
<https://indico.dns-oarc.net/event/21/contribution/9>.
[RFC2181] Elz, R. and R. Bush, "Clarifications to the DNS
Specification", RFC 2181, DOI 10.17487/RFC2181, July 1997,
<https://www.rfc-editor.org/info/rfc2181>.
[RFC6672] Rose, S. and W. Wijngaards, "DNAME Redirection in the
DNS", RFC 6672, DOI 10.17487/RFC6672, June 2012,
<https://www.rfc-editor.org/info/rfc6672>.
[RFC6895] Eastlake 3rd, D., "Domain Name System (DNS) IANA
Considerations", BCP 42, RFC 6895, DOI 10.17487/RFC6895,
April 2013, <https://www.rfc-editor.org/info/rfc6895>.
[RFC7816] Bortzmeyer, S., "DNS Query Name Minimisation to Improve
Privacy", RFC 7816, DOI 10.17487/RFC7816, March 2016,
<https://www.rfc-editor.org/info/rfc7816>.
[RFC8020] Bortzmeyer, S. and S. Huque, "NXDOMAIN: There Really Is
Nothing Underneath", RFC 8020, DOI 10.17487/RFC8020,
November 2016, <https://www.rfc-editor.org/info/rfc8020>.
[RFC8198] Fujiwara, K., Kato, A., and W. Kumari, "Aggressive Use of
DNSSEC-Validated Cache", RFC 8198, DOI 10.17487/RFC8198,
July 2017, <https://www.rfc-editor.org/info/rfc8198>.
[RFC9076] Wicinski, T., Ed., "DNS Privacy Considerations", RFC 9076,
DOI 10.17487/RFC9076, July 2021,
<https://www.rfc-editor.org/info/rfc9076>.
[verisign-qnamemin]
Thomas, M., "Maximizing Qname Minimization: A New Chapter
in DNS Protocol Evolution", September 2020,
<https://blog.verisign.com/security/maximizing-qname-
minimization-a-new-chapter-in-dns-protocol-evolution/>.
Acknowledgments π«Ά
The acknowledgments from RFC 7816 apply here. In addition, many participants from the DNSOP Working Group helped with proposals for simplification, clarification, and general editorial help π.
Authors' Addresses π
Stephane Bortzmeyer
AFNIC
1, rue Stephenson
78180 Montigny-le-Bretonneux
France
Phone: +33 1 39 30 83 46
Email: bortzmeyer+ietf@nic.fr
URI: https://www.afnic.fr/
Ralph Dolmans
NLnet Labs
Email: ralph@nlnetlabs.nl
Paul Hoffman
ICANN
Email: paul.hoffman@icann.org
π¦ where this page comes from
- ietf: rfc9156 2021-11
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms