<?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-ietf-dnsop-glue-is-not-optional-04" submissionType="IETF" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" updates="1034" indexInclude="false" consensus="true">

<front>
<title>DNS Referral Glue Requirements</title><seriesInfo value="draft-ietf-dnsop-glue-is-not-optional-04" stream="IETF" status="standard" name="Internet-Draft"></seriesInfo>
<author initials="M." surname="Andrews" fullname="M. Andrews"><organization>ISC</organization><address><postal><street></street>
</postal><email>marka@isc.org</email>
</address></author><author initials="S." surname="Huque" fullname="Shumon Huque"><organization>Salesforce</organization><address><postal><street></street>
</postal><email>shuque@gmail.com</email>
</address></author><author initials="P." surname="Wouters" fullname="Paul Wouters"><organization>Aiven</organization><address><postal><street></street>
</postal><email>paul.wouters@aiven.io</email>
</address></author><author initials="D." surname="Wessels" fullname="Duane Wessels"><organization>Verisign</organization><address><postal><street></street>
</postal><email>dwessels@verisign.com</email>
</address></author><date/>
<area>Operations</area>
<workgroup>DNSOP</workgroup>

<abstract>
<t>The DNS uses referral glue records to allow iterative clients to find the
   addresses of nameservers that are contained within a delegated zone.
   Authoritative Servers are expected to return all available referral glue records
   in a referral response. If message size constraints prevent the inclusion of all
   in-domain referral glue records, the server MUST set the TC flag to
   inform the client that the response is incomplete, and that the client
   SHOULD use another transport to retrieve the full response.
   This document updates RFC 1034 to clarify correct server behavior.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t>The Domain Name System (DNS) <xref target="RFC1034"></xref>, <xref target="RFC1035"></xref> uses referral glue records
   to allow iterative clients to find the addresses of nameservers that are
   contained within a delegated zone. Referral glue records are added to the parent
   zone as part of the delegation process and returned in referral responses,
   otherwise a resolver following the referral has no way of finding these
   addresses. Authoritative servers are expected to return all available
   in-domain referral glue records in a referral response. If message size constraints prevent the
   inclusion of all in-domain glue records over the chosen transport, the server MUST set the
   TC (Truncated) flag to inform the client that the response is incomplete,
   and that the client SHOULD use another transport retrieve the full response. This
   document clarifies that expectation.</t>
<t>DNS responses sometimes contain optional data in the additional
   section. In-domain referral glue records, however, are not optional. Several other
   protocol extensions, when used, are also not optional. This
   includes TSIG <xref target="RFC2845"></xref>, OPT <xref target="RFC6891"></xref>, and SIG(0) <xref target="RFC2931"></xref>.</t>
<t>At the time of this writing, referral glue is the only type of
   glue defined for the DNS.  Referral glue records are always
   addresses (A or AAAA records) of a delegation's authoritative
   name servers.  New work underway in the IETF may lead to definitions
   for other types of glue data, with requirements that differ from
   referral glue.  This document only describes requirements for
   referral glue.  Unless stated otherwise, &quot;glue&quot; in the remainder of this document
   always means &quot;referral glue.&quot;</t>
<t>Note that this document only clarifies requirements of name server
   software implementations.  It does not place any requirements on
   data placed in DNS zones or registries.</t>

<section anchor="reserved-words"><name>Reserved Words</name>
<t>The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;,
   &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;, &quot;MAY&quot;, and &quot;OPTIONAL&quot; in this
   document are to be interpreted as described in <xref target="RFC2119"></xref>.</t>
</section>
</section>

<section anchor="types-of-referral-glue"><name>Types of Referral Glue</name>
<t>This section describes different types of glue that may be found in
   DNS referral responses.  Note that the type of glue depends on
   the QNAME.  A particular record can be in-domain glue for one response
   and sibling glue for another.</t>

<section anchor="indomainglue"><name>In-Domain Referral Glue</name>
<t>The following is a simple example of glue records present in the
   delegating zone &quot;test&quot; for the child zone &quot;foo.test&quot;. The nameservers
   for foo.test (ns1.foo.test and ns2.foo.test) are both below the
   delegation point. They are configured as glue records in the &quot;test&quot; zone:</t>

<artwork>   foo.test.                  86400   IN NS      ns1.foo.test.
   foo.test.                  86400   IN NS      ns2.foo.test.
   ns1.foo.test.              86400   IN A       192.0.2.1
   ns2.foo.test.              86400   IN AAAA    2001:db8::2:2
</artwork>
<t>A referral response from &quot;test&quot; for &quot;foo.test&quot; with in-domain
   glue looks like this:</t>

<artwork>   ;; QUESTION SECTION:
   ;www.foo.test.  	IN	A

   ;; AUTHORITY SECTION:
   foo.test.               86400	IN	NS	ns1.foo.test.
   foo.test.               86400	IN	NS	ns2.foo.test.

   ;; ADDITIONAL SECTION:
   ns1.foo.test.           86400	IN	A	192.0.2.1
   ns2.foo.test.           86400	IN	AAAA	2001:db8::2:2
</artwork>
</section>

<section anchor="siblingglue"><name>Sibling Referral Glue</name>
<t>Sibling glue are glue records that are not contained in the delegated
   zone itself, but in another zone delegated from the same parent. In many
   cases, these are not strictly required for resolution, since the resolver
   can make follow-on queries to the other zone to resolve the nameserver
   addresses after following the referral to the sibling zone. However,
   most nameserver implementations today provide them as an optimization
   to obviate the need for extra traffic from iterative resolvers.</t>
<t>Here the delegating zone &quot;test&quot; contains two delegations for the
   child zones &quot;bar.test&quot; and &quot;foo.test&quot;:</t>

<artwork>   bar.test.                  86400   IN NS      ns1.bar.test.
   bar.test.                  86400   IN NS      ns2.bar.test.
   ns1.bar.test.              86400   IN A       192.0.2.1
   ns2.bar.test.              86400   IN AAAA    2001:db8::2:2

   foo.test.                  86400   IN NS      ns1.bar.test.
   foo.test.                  86400   IN NS      ns2.bar.test.
</artwork>
<t>A referral response from &quot;test&quot; for &quot;foo.test&quot; with sibling glue
  looks like this:</t>

<artwork>   ;; QUESTION SECTION:
   ;www.foo.test.  	IN	A

   ;; AUTHORITY SECTION:
   foo.test.               86400	IN	NS	ns1.bar.test.
   foo.test.               86400	IN	NS	ns2.bar.test.

   ;; ADDITIONAL SECTION:
   ns1.bar.test.           86400	IN	A	192.0.2.1
   ns2.bar.test.           86400	IN	AAAA	2001:db8::2:2
</artwork>
</section>

<section anchor="siblingcyclicglue"><name>Cyclic Sibling Referral Glue</name>
<t>The use of sibling glue can introduce cyclic dependencies.  This
   happens when one domain specifies name servers from a sibling domain,
   and vice versa.  This type of cyclic dependency can only be
   broken when the delegating name server includes the sibling
   glue in a referral response.</t>
<t>Here the delegating zone &quot;test&quot; contains two delegations for the
   child zones &quot;bar.test&quot; and &quot;foo.test&quot;, and each use name servers under
   the other:</t>

<artwork>   bar.test.                  86400   IN NS      ns1.foo.test.
   bar.test.                  86400   IN NS      ns2.foo.test.
   ns1.bar.test.              86400   IN A       192.0.2.1
   ns2.bar.test.              86400   IN AAAA    2001:db8::2:2

   foo.test.                  86400   IN NS      ns1.bar.test.
   foo.test.                  86400   IN NS      ns2.bar.test.
   ns1.foo.test.              86400   IN A       192.0.2.3
   ns2.foo.test.              86400   IN AAAA    2001:db8::2:4
</artwork>
<t>A referral response from &quot;test&quot; for &quot;bar.test&quot; with sibling glue
  looks like this:</t>

<artwork>   ;; QUESTION SECTION:
   ;www.bar.test.  	IN	A

   ;; AUTHORITY SECTION:
   bar.test.               86400	IN	NS	ns1.foo.test.
   bar.test.               86400	IN	NS	ns2.foo.test.

   ;; ADDITIONAL SECTION:
   ns1.foo.test.           86400	IN	A	192.0.2.3
   ns2.foo.test.           86400	IN	AAAA	2001:db8::2:4
</artwork>
<t>In late 2021 the authors analyzed zone file data available from ICANN's
   Centralized Zone Data Service <xref target="CZDS"></xref> and found 222 out of approximately
   209,000,000 total delegations that had only sibling NS RRs in a cyclic
   dependency as above.</t>
</section>

<section anchor="missing-referral-glue"><name>Missing Referral Glue</name>
<t>An example of missing glue is included here, even though it can not be considered
   as a type of glue.  While not common, real examples of responses
   that lack required glue, and with TC=0, have been shown to occur and
   cause resolution failures.</t>
<t>The example below is based on a response observed in June 2020.  The names have
   been altered to fall under documentation domains.  It shows a case where none of
   the glue records present in the zone fit into the available space of the UDP response, and
   the TC flag was not set.  While this example shows a referral with DNSSEC records
   <xref target="RFC4033"></xref>, <xref target="RFC4034"></xref>, <xref target="RFC4035"></xref>, this behavior has
   been seen with plain DNS responses as well.  Some records have
   been truncated for display purposes. Note that at the time of this
   writing, the servers originally responsible for this example have been updated and now correctly
   set the TC flag.</t>

<artwork>   % dig +norec +dnssec +bufsize=512 +ignore @ns.example.net \
          rh202ns2.355.foo.example

   ; &lt;&lt;&gt;&gt; DiG 9.15.4 &lt;&lt;&gt;&gt; +norec +dnssec +bufsize +ignore \
          @ns.example.net rh202ns2.355.foo.example
   ; (2 servers found)
   ;; global options: +cmd
   ;; Got answer:
   ;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 8798
   ;; flags: qr; QUERY: 1, ANSWER: 0, AUTHORITY: 9, ADDITIONAL: 1

   ;; OPT PSEUDOSECTION:
   ; EDNS: version: 0, flags: do; udp: 4096
   ;; QUESTION SECTION:
   ;rh202ns2.355.foo.example.         IN A

   ;; AUTHORITY SECTION:
   foo.example.          86400   IN NS      rh120ns2.368.foo.example.
   foo.example.          86400   IN NS      rh202ns2.355.foo.example.
   foo.example.          86400   IN NS      rh120ns1.368.foo.example.
   foo.example.          86400   IN NS      rh202ns1.355.foo.example.
   foo.example.          3600    IN DS      51937 8 1 ...
   foo.example.          3600    IN DS      635 8 2 ...
   foo.example.          3600    IN DS      51937 8 2 ...
   foo.example.          3600    IN DS      635 8 1 ...
   foo.example.          3600    IN RRSIG   DS 8 2 3600 ...
</artwork>
</section>
</section>

<section anchor="requirements"><name>Requirements</name>
<t>This section describes updated requirements for including glue in referral responses.</t>

<section anchor="in-domain-referral-glue"><name>In-Domain Referral Glue</name>
<t>This document clarifies that when a name server generates a referral
   response, it MUST include all available in-domain glue records in the
   additional section, or MUST set TC=1 if constrained by message size.</t>
<t>At the time of writing, most iterative clients send initial queries
   over UDP and retry over TCP upon receiving a response with the TC
   flag set.  UDP responses are generally limited to between 1232 and 4096
   bytes, due to values commonly used for the EDNS0 UDP Message Size field
   <xref target="RFC6891"></xref>, <xref target="FLAGDAY2020"></xref>.  TCP responses are limited to 65,536 bytes.</t>
</section>

<section anchor="sibling-referral-glue"><name>Sibling Referral Glue</name>
<t>This document clarifies that when a name server generates a referral
   response, it SHOULD include all available glue records in the
   additional section.  If after adding all in-domain glue records, not all sibling glue records fit due to message size constraints,
   the name server is NOT REQUIRED to set TC=1.</t>
<t>Note that users may experience resolution failures for domains with only sibling glue
   when a name servers chooses to omit them in a referral response.  As described in
   <xref target="siblingcyclicglue"></xref>, such domains are rare.</t>
</section>

<section anchor="updates-to-rfc-1034"><name>Updates to RFC 1034</name>
<t>Replace</t>
<t>&quot;Copy the NS RRs for the subzone into the authority section of the
   reply.  Put whatever addresses are available into the additional
   section, using glue RRs if the addresses are not available from
   authoritative data or the cache.  Go to step 4.&quot;</t>
<t>with</t>
<t>&quot;Copy the NS RRs for the subzone into the authority section of the
   reply.  Put whatever NS addresses are available into the additional
   section, using glue RRs if the addresses are not available from
   authoritative data or the cache.  If all in-domain glue RRs do not fit, set TC=1 in
   the header.  Go to step 4.&quot;</t>
</section>
</section>

<section anchor="security-considerations"><name>Security Considerations</name>
<t>This document clarifies correct DNS server behavior and does not introduce
   any changes or new security considerations.</t>
</section>

<section anchor="operational-considerations"><name>Operational Considerations</name>
<t>At the time of this writing, the behavior of most DNS server
   implementations is to set the TC flag only if none of the available
   glue records fit in a response over UDP transport.  The updated
   requirements in this document might lead to an increase in the fraction
   of UDP responses with the TC flag set, and consequently an increase
   in the number of queries to over TCP transport.</t>
</section>

<section anchor="iana-considerations"><name>IANA Considerations</name>
<t>There are no actions for IANA.</t>
</section>

<section anchor="acknowledgements"><name>Acknowledgements</name>
<t>The authors wish to thank
   Joe Abley,
   Brian Dickson,
   Geoff Huston,
   Jared Mauch,
   George Michaelson,
   Benno Overeinder,
   John R Levine,
   Shinta Sato,
   Puneet Sood,
   Ralf Weber,
   Tim Wicinski,
   Suzanne Woolf,
   and other members of the DNSOP working group
   for their input.</t>
</section>

<section anchor="changes"><name>Changes</name>
<t>RFC Editor: Please remove this section before publication.</t>
<t>This section lists substantial changes to the document as it is being worked on.</t>
<t>From -01 to -02:</t>

<ul>
<li>Clarified that &quot;servers&quot; means &quot;authoritative servers&quot;.</li>
<li>Clarified that &quot;available glue&quot; means &quot;all available glue&quot;.</li>
<li>Updated examples and placed before RFC 1034 update.</li>
</ul>
<t>From -02 to -03:</t>

<ul>
<li>Clarified scope to focus only on name server responses, and not zone/registry data.</li>
<li>Reorganized with section 2 as Types of Glue and section 3 as Requirements.</li>
<li>Removed any discussion of promoted / orphan glue.</li>
<li>Use appropriate documentation addresses and domain names.</li>
<li>Added Sibling Cyclic Glue example.</li>
</ul>
<t>From -03 to -04:</t>

<ul>
<li>Use &quot;referral glue&quot; on the assumption that other types of glue may be defined in the future.</li>
<li>Added Operational Considerations section.</li>
<li>Note many current implementations set TC=1 only when no glue RRs fit.  New requirements may lead to more truncation and TCP.</li>
<li>Sibling glue can be optional.  Only require TC=1 when all in-domain glue RRs don't fit.</li>
<li>Avoid talking about requirements for UDP/TCP specifically, and talk more generically about message size constraints regardless of transport.</li>
</ul>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1034.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1035.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
</references>
<references><name>Informative References</name>
<reference anchor="CZDS" target="https://czds.icann.org/">
  <front>
    <title>Centralized Zone Data Service</title>
    <author>
      <organization>ICANN</organization>
    </author>
    <date year="2022" month="January"></date>
  </front>
  <refcontent></refcontent>
</reference>
<reference anchor="FLAGDAY2020" target="https://dnsflagday.net/2020/">
  <front>
    <title>DNS Flag Day 2020</title>
    <author>
      <organization>Various DNS software and service providers</organization>
    </author>
    <date year="2020" month="Oct"></date>
  </front>
  <refcontent></refcontent>
</reference>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2845.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2931.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4033.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4034.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4035.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6891.xml"/>
</references>

</back>

</rfc>
