<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-levine-qmin-performance-00" submissionType="IETF" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" updates="9156" indexInclude="true" consensus="true">

<front>
<title abbrev="DNSSEC NOTIFY">Mitigating QNAME minimization performance problems</title><seriesInfo value="draft-levine-qmin-performance-00" stream="IETF" status="standard" name="Internet-Draft"></seriesInfo>
<author initials="J." surname="Levine" fullname="John Levine"><organization>Standcore LLC</organization><address><postal><street></street>
</postal><email>standards@standcore.com</email>
</address></author><date/>
<area>Operations</area>
<workgroup></workgroup>
<keyword>DNS</keyword>
<keyword>QNAME minimization</keyword>

<abstract>
<t>QNAME minimization improves DNS privacy by truncating query names
sent to authoritative name servers.
While it works well when there is a zone cut between each label in a name,
when a zone includes more than one level of labels, it can cause multiple
redundant queries to the same server, significantly increasing the load
on that server without additional privacy benefits.
This document describes some situations where minimization causes load
problems and potential ways to fix the problem.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t><xref target="RFC9156"></xref> defines
QNAME minimization, a method to improve DNS privacy by truncating query names
sent to authoritative name servers.
In effect it probes the DNS one label at a time.
If one looks up www.bigbank.example, minimization makes the DNS cache
send a query for example to the root, a query for bigbank.example to
a server for example, and the real query for www.bigbank.example to
a server for bigbank.example.</t>
<t>This works well when there is a zone cut between each label in a name,
since the number of queries is the same as it would be without minimization.
But when a zone includes more than one level of labels, it can cause multiple
redundant queries to the same server, significantly increasing the load
on that server without additional privacy benefits.</t>
</section>

<section anchor="boom"><name>Query name explosions</name>
<t>In <xref target="firstlook"></xref> the authors instrumented some popular name servers and
found that minimization increased traffic to Unbound by 17-19% and to BIND
by 15-26%.
It does not appear that they tried to tell whether traffic to some zones
increased more than others.</t>
<t>DNSBLs <xref target="RFC5782"></xref> turn IP addresses into domain names using the same octet or
digit reversing technique that rDNS uses.
Mail clients look up the domain name to see if the IP is listed.
For example, a listing for IP 192.0.2.99 might be looed up
at 99.2.0.192.bad.example.com.
Similarly an IPv6 address 2001:db8:1:2:3:4:567:89ab
would be looked up at
b.a.9.8.7.6.5.0.4.0.0.0.3.0.0.0.2.0.0.0.1.0.0.0.8.b.d.0.1.0.0.2.bad.example.com.</t>
<t>Since DNSBL domain names have a lot of labels, they are unusually
affected by QNAME minimization.
In the absence of minimization, both of those domain names would usually
be looked up with a single query.
The base domain bad.example.com is likely to be cached from prior DNSBL
lookups, and the DNSBL is a single zone.
With minimization, it may be as many as 4 for the IPv4 address and 18 for
the IPv6 address.
<xref target="RFC9156" sectionFormat="of" relative="#" section="2.3"></xref> suggests limiting the number of queries but the
suggested limit is 10 which doesn't help much.</t>
<t>Since mail comes from all over the IP address space, caches don't help much.
The author did some simulations of DNSBL traffic using traces of IP addresses
and found that a results were only used about once before being removed
from the cache.
A few very heavily used addresses remained in the cache indefinitely, but
a long tail of queries for small senders (typically spambots) weren't reused at all.</t>
</section>

<section anchor="fix"><name>Mitigations</name>
<t>Several minor changes to QNAME minimization could significantly decrease
the number of redundant queries with little or decrease in privacy.</t>

<section anchor="psl"><name>Public Suffix List</name>
<t>In <xref target="secondlook"></xref> the authors observe that it is rare for domains under
a registered domain to be under different management.
They suggest that caches use a Public Suffix List (PSL) and stop truncating
after PSL+1, one label below a PSL entry.
For example, since &quot;com&quot; is in the PSL, a lookup for a.b.example.com
wouod query com, then example.com, then stop truncating and query
a.b.example.com.</t>
<t>This has two practical disadvantages.
One is that the PSL is a large static file, currently about 300K, so
periodically fetching it (it changes nearly every day) is a fair amount of added work.
The other is that many of the PSL entries, particularly the longer ones in
the &quot;private&quot; section in the PSL, are
irrelevant to query minimization because the names below the PSL entry are
all in the same zone.</t>
</section>

<section anchor="stopme"><name>Additional stop patterns</name>
<t><xref target="RFC9156" sectionFormat="of" relative="#" section="2.3"></xref> suggests that labels that start with an underscore
be treated as a special case, to stop truncation when one is encountered.</t>
<t>To deal with the DNSBL situation, if the remaining labels are four groups
of digits, or sixteen single hex digit labels, stop because it's probably
a DNSBL.
Depending on how one feels about leaking info to RIRs, one might want
to special case the in-addr.arpa and ip6.arpa domains since rDNS has the
same syntax, but the rDNS tree has a lot of zone cuts.</t>
<t>Other names with the same problem, many labels in the same zone include TBD.</t>
</section>

<section anchor="three"><name>Stop at two or three</name>
<t>In <xref target="secondlook"></xref> the authors found that Google's DNS
stopped truncating after two labels, since this got most of the benefit
of full minimization with no increase in the load.
They discovered this by accident when doing minimization tests on four
label names, and Google appeared to their test not to minimize.</t>
<t>Most top-level domains have registered names at the second level, and
nearly all at the second or third level. so stopping after three labels
would likely get nearly all of the benefit at very low cost.</t>
</section>
</section>

<section anchor="security"><name>Security considerations</name>
<t>Less minimizing means more leakage, but if done sensibly, not much.</t>
<t>Depending on your point of view, quadrupling the load on servers based
on the structure of their zones might or might not be a security issue.</t>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9156.xml"/>
</references>
<references><name>Informative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5782.xml"/>
<reference anchor="firstlook" target="https://www.researchgate.net/publication/331690595_A_First_Look_at_QNAME_Minimization_in_the_Domain_Name_System">
  <front>
    <title>A First Look at DNS QNAME Minimization</title>
    <author fullname="Wouter de Vries" initials="W." surname="de Vries">
      <organization>University of Twente</organization>
      <address>
        <email>w.b.devries@utwente.nl</email>
      </address>
    </author>
    <author fullname="Moritz Müller" initials="M." surname="Müller">
      <organization>SIDN Labs</organization>
    </author>
    <author fullname="Roland van Rijswijk-Deij" initials="R." surname="van Rijswijk-Deij">
      <organization>University of Twente</organization>
    </author>
    <author fullname="Willem Torop" initials="W." surname="Wilem">
      <organization>NLnet Labs</organization>
    </author>
    <date year="2019" month="3"></date>
  </front>
</reference>
<reference anchor="secondlook" target="https://link.springer.com/chapter/10.1007/978-3-031-28486-1_21">
  <front>
    <title>A Second Look at DNS QNAME Minimization</title>
    <author fullname="Jonathan Magnusson" initials="J." surname="Magnusson">
      <organization>Karlstad University, Karlstad, Sweden</organization>
      <address>
        <email>jonathan.magnusson@kau.se</email>
      </address>
    </author>
    <author fullname="Moritz Müller" initials="M." surname="Müller">
      <organization>SIDN Labs</organization>
    </author>
    <author fullname="Anna Brunstrom" initials="A." surname="Brunstrom">
      <organization>Karlstad University, Karlstad, Sweden</organization>
    </author>
    <author fullname="Tobias Pulls" initials="T." surname="Pulls">
      <organization>Karlstad University, Karlstad, Sweden</organization>
    </author>
    <date year="2023" month="3"></date>
  </front>
</reference>
</references>

</back>

</rfc>
