<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" ipr="trust200902" docName="draft-ietf-dnsop-qdcount-is-one-04" number="9619" category="std" consensus="true" submissionType="IETF" updates="1035" obsoletes="" tocInclude="true" sortRefs="true" symRefs="true" xml:lang="en" prepTime="2024-07-24T10:25:21" indexInclude="true" scripts="Common,Latin" tocDepth="3">
  <link href="https://datatracker.ietf.org/doc/draft-ietf-dnsop-qdcount-is-one-04" rel="prev"/>
  <link href="https://dx.doi.org/10.17487/rfc9619" rel="alternate"/>
  <link href="urn:issn:2070-1721" rel="alternate"/>
  <front>
    <title abbrev="In the DNS, QDCOUNT Is (Usually) One">In the DNS, QDCOUNT Is (Usually) One</title>
    <seriesInfo name="RFC" value="9619" stream="IETF"/>
    <author initials="R." surname="Bellis" fullname="Ray Bellis">
      <organization abbrev="ISC" showOnFrontPage="true">Internet Systems Consortium, Inc.</organization>
      <address>
        <postal>
          <street>PO Box 360</street>
          <city>Newmarket</city>
          <region>NH</region>
          <code>03857</code>
          <country>United States of America</country>
        </postal>
        <phone>+1 650 423 1300</phone>
        <email>ray@isc.org</email>
      </address>
    </author>
    <author initials="J." surname="Abley" fullname="Joe Abley">
      <organization showOnFrontPage="true">Cloudflare</organization>
      <address>
        <postal>
          <city>Amsterdam</city>
          <country>Netherlands</country>
        </postal>
        <phone>+31 6 45 56 36 34</phone>
        <email>jabley@cloudflare.com</email>
      </address>
    </author>
    <date month="07" year="2024"/>
    <area>OPS</area>
    <workgroup>dnsop</workgroup>
    <abstract pn="section-abstract">
      <t indent="0" pn="section-abstract-1">This document updates RFC 1035 by constraining the allowed value of the
QDCOUNT parameter in DNS messages with OPCODE = 0 (QUERY) to a maximum
of one, and it specifies the required behavior when values that are not
allowed are encountered.</t>
    </abstract>
    <boilerplate>
      <section anchor="status-of-memo" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.1">
        <name slugifiedName="name-status-of-this-memo">Status of This Memo</name>
        <t indent="0" pn="section-boilerplate.1-1">
            This is an Internet Standards Track document.
        </t>
        <t indent="0" pn="section-boilerplate.1-2">
            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.
        </t>
        <t indent="0" pn="section-boilerplate.1-3">
            Information about the current status of this document, any
            errata, and how to provide feedback on it may be obtained at
            <eref target="https://www.rfc-editor.org/info/rfc9619" brackets="none"/>.
        </t>
      </section>
      <section anchor="copyright" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.2">
        <name slugifiedName="name-copyright-notice">Copyright Notice</name>
        <t indent="0" pn="section-boilerplate.2-1">
            Copyright (c) 2024 IETF Trust and the persons identified as the
            document authors. All rights reserved.
        </t>
        <t indent="0" pn="section-boilerplate.2-2">
            This document is subject to BCP 78 and the IETF Trust's Legal
            Provisions Relating to IETF Documents
            (<eref target="https://trustee.ietf.org/license-info" brackets="none"/>) 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.
        </t>
      </section>
    </boilerplate>
    <toc>
      <section anchor="toc" numbered="false" removeInRFC="false" toc="exclude" pn="section-toc.1">
        <name slugifiedName="name-table-of-contents">Table of Contents</name>
        <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1">
          <li pn="section-toc.1-1.1">
            <t indent="0" keepWithNext="true" pn="section-toc.1-1.1.1"><xref derivedContent="1" format="counter" sectionFormat="of" target="section-1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-introduction">Introduction</xref></t>
          </li>
          <li pn="section-toc.1-1.2">
            <t indent="0" keepWithNext="true" pn="section-toc.1-1.2.1"><xref derivedContent="2" format="counter" sectionFormat="of" target="section-2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-terminology-used-in-this-do">Terminology Used in This Document</xref></t>
          </li>
          <li pn="section-toc.1-1.3">
            <t indent="0" keepWithNext="true" pn="section-toc.1-1.3.1"><xref derivedContent="3" format="counter" sectionFormat="of" target="section-3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-qdcount-is-usually-one">QDCOUNT Is (Usually) One</xref></t>
          </li>
          <li pn="section-toc.1-1.4">
            <t indent="0" pn="section-toc.1-1.4.1"><xref derivedContent="4" format="counter" sectionFormat="of" target="section-4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-updates-to-rfc-1035">Updates to RFC 1035</xref></t>
          </li>
          <li pn="section-toc.1-1.5">
            <t indent="0" pn="section-toc.1-1.5.1"><xref derivedContent="5" format="counter" sectionFormat="of" target="section-5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-security-considerations">Security Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.6">
            <t indent="0" pn="section-toc.1-1.6.1"><xref derivedContent="6" format="counter" sectionFormat="of" target="section-6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-iana-considerations">IANA Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.7">
            <t indent="0" pn="section-toc.1-1.7.1"><xref derivedContent="7" format="counter" sectionFormat="of" target="section-7"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-references">References</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.7.2">
              <li pn="section-toc.1-1.7.2.1">
                <t indent="0" pn="section-toc.1-1.7.2.1.1"><xref derivedContent="7.1" format="counter" sectionFormat="of" target="section-7.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-normative-references">Normative References</xref></t>
              </li>
              <li pn="section-toc.1-1.7.2.2">
                <t indent="0" pn="section-toc.1-1.7.2.2.1"><xref derivedContent="7.2" format="counter" sectionFormat="of" target="section-7.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-informative-references">Informative References</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.8">
            <t indent="0" pn="section-toc.1-1.8.1"><xref derivedContent="Appendix A" format="default" sectionFormat="of" target="section-appendix.a"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-guidance-for-the-use-of-qdc">Guidance for the Use of QDCOUNT in the DNS Specification</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.8.2">
              <li pn="section-toc.1-1.8.2.1">
                <t indent="0" pn="section-toc.1-1.8.2.1.1"><xref derivedContent="A.1" format="counter" sectionFormat="of" target="section-appendix.a.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-opcode-0-query-and-1-iquery">OPCODE = 0 (QUERY) and 1 (IQUERY)</xref></t>
              </li>
              <li pn="section-toc.1-1.8.2.2">
                <t indent="0" pn="section-toc.1-1.8.2.2.1"><xref derivedContent="A.2" format="counter" sectionFormat="of" target="section-appendix.a.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-opcode-4-notify">OPCODE = 4 (NOTIFY)</xref></t>
              </li>
              <li pn="section-toc.1-1.8.2.3">
                <t indent="0" pn="section-toc.1-1.8.2.3.1"><xref derivedContent="A.3" format="counter" sectionFormat="of" target="section-appendix.a.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-opcode-5-update">OPCODE = 5 (UPDATE)</xref></t>
              </li>
              <li pn="section-toc.1-1.8.2.4">
                <t indent="0" pn="section-toc.1-1.8.2.4.1"><xref derivedContent="A.4" format="counter" sectionFormat="of" target="section-appendix.a.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-opcode-6-dns-stateful-opera">OPCODE = 6 (DNS Stateful Operations, DSO)</xref></t>
              </li>
              <li pn="section-toc.1-1.8.2.5">
                <t indent="0" pn="section-toc.1-1.8.2.5.1"><xref derivedContent="A.5" format="counter" sectionFormat="of" target="section-appendix.a.5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-conclusion">Conclusion</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.9">
            <t indent="0" pn="section-toc.1-1.9.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.b"/><xref derivedContent="" format="title" sectionFormat="of" target="name-acknowledgements">Acknowledgements</xref></t>
          </li>
          <li pn="section-toc.1-1.10">
            <t indent="0" pn="section-toc.1-1.10.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.c"/><xref derivedContent="" format="title" sectionFormat="of" target="name-authors-addresses">Authors' Addresses</xref></t>
          </li>
        </ul>
      </section>
    </toc>
  </front>
  <middle>
    <section anchor="introduction" numbered="true" removeInRFC="false" toc="include" pn="section-1">
      <name slugifiedName="name-introduction">Introduction</name>
      <t indent="0" pn="section-1-1">The DNS protocol <xref target="RFC1034" format="default" sectionFormat="of" derivedContent="RFC1034"/> <xref target="RFC1035" format="default" sectionFormat="of" derivedContent="RFC1035"/> includes a parameter
QDCOUNT in the DNS message header whose value is specified to mean
the number of questions in the Question section of a DNS message.</t>
      <t indent="0" pn="section-1-2">In a general sense, it seems perfectly plausible for the QDCOUNT
parameter, an unsigned 16-bit value, to take a considerable range
of values. However, in the specific case of messages that encode
DNS queries and responses (messages with OPCODE = 0), there are other
limitations inherent in the protocol that constrain values of QDCOUNT
to be either 0 or 1. In particular, several parameters specified
for DNS response messages such as AA and RCODE have no defined
meaning when the message contains multiple queries as there is
no way to signal which question those parameters relate to.</t>
      <t indent="0" pn="section-1-3">In this document, we briefly survey the existing written DNS
specification; provide a description of the semantic and practical
requirements for DNS queries that naturally constrain the allowable
values of QDCOUNT; and update the DNS base specification to
clarify the allowable values of the QDCODE parameter in the specific
case of DNS messages with OPCODE = 0.</t>
    </section>
    <section anchor="terminology-used-in-this-document" numbered="true" removeInRFC="false" toc="include" pn="section-2">
      <name slugifiedName="name-terminology-used-in-this-do">Terminology Used in This Document</name>
      <t indent="0" pn="section-2-1">
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>",
    "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>",
    "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>",
    "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be
    interpreted as described in BCP 14 <xref target="RFC2119" format="default" sectionFormat="of" derivedContent="RFC2119"/> <xref target="RFC8174" format="default" sectionFormat="of" derivedContent="RFC8174"/> when, and only when, they appear in all capitals, as
    shown here.
      </t>
    </section>
    <section anchor="qdcount-is-usually-one" numbered="true" removeInRFC="false" toc="include" pn="section-3">
      <name slugifiedName="name-qdcount-is-usually-one">QDCOUNT Is (Usually) One</name>
      <t indent="0" pn="section-3-1">A brief summary of the guidance provided in the existing DNS
specification (<xref target="RFC1035" format="default" sectionFormat="of" derivedContent="RFC1035"/> and many other documents) for the use of QDCOUNT can be found in <xref target="Survey" format="default" sectionFormat="of" derivedContent="Appendix A"/>.
While the specification is clear in many cases, there is some ambiguity in the specific case of OPCODE = 0, which this
document aims to eliminate.</t>
    </section>
    <section anchor="updates-to-rfc-1035" numbered="true" removeInRFC="false" toc="include" pn="section-4">
      <name slugifiedName="name-updates-to-rfc-1035">Updates to RFC 1035</name>
      <t indent="0" pn="section-4-1">A DNS message with OPCODE = 0 <bcp14>MUST NOT</bcp14> include a QDCOUNT
parameter whose value is greater than 1. It follows that the Question
section of a DNS message with OPCODE = 0 <bcp14>MUST NOT</bcp14> contain more than
one question.</t>
      <t indent="0" pn="section-4-2">A DNS message with OPCODE = 0 and QDCOUNT &gt; 1 <bcp14>MUST</bcp14> be treated
as an incorrectly formatted message.  The value of the RCODE parameter
in the response message <bcp14>MUST</bcp14> be set to 1 (FORMERR).</t>
      <t indent="0" pn="section-4-3">Middleboxes (e.g., firewalls) that process DNS messages in order to eliminate unwanted
traffic <bcp14>SHOULD</bcp14> treat messages with OPCODE = 0 and QDCOUNT &gt; 1 as
malformed traffic and return a FORMERR response as described above.
Such firewalls <bcp14>MUST NOT</bcp14> treat messages with OPCODE = 0 and QDCOUNT = 0
as malformed.  See <xref target="RFC8906" sectionFormat="of" section="4" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8906#section-4" derivedContent="RFC8906"/> for further guidance.</t>
    </section>
    <section anchor="security-considerations" numbered="true" removeInRFC="false" toc="include" pn="section-5">
      <name slugifiedName="name-security-considerations">Security Considerations</name>
      <t indent="0" pn="section-5-1">This document clarifies the DNS specification <xref target="RFC1035" format="default" sectionFormat="of" derivedContent="RFC1035"/> and aims to improve
interoperability between different DNS implementations. In general, the elimination of ambiguity seems well-aligned with security
hygiene.</t>
    </section>
    <section anchor="iana-considerations" numbered="true" removeInRFC="false" toc="include" pn="section-6">
      <name slugifiedName="name-iana-considerations">IANA Considerations</name>
      <t indent="0" pn="section-6-1">This document has no IANA actions.</t>
    </section>
  </middle>
  <back>
    <references pn="section-7">
      <name slugifiedName="name-references">References</name>
      <references anchor="sec-normative-references" pn="section-7.1">
        <name slugifiedName="name-normative-references">Normative References</name>
        <reference anchor="RFC1034" target="https://www.rfc-editor.org/info/rfc1034" quoteTitle="true" derivedAnchor="RFC1034">
          <front>
            <title>Domain names - concepts and facilities</title>
            <author fullname="P. Mockapetris" initials="P." surname="Mockapetris"/>
            <date month="November" year="1987"/>
            <abstract>
              <t indent="0">This RFC is the revised basic definition of The Domain Name System. It obsoletes RFC-882. This memo describes the domain style names and their used for host address look up and electronic mail forwarding. It discusses the clients and servers in the domain name system and the protocol used between them.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="13"/>
          <seriesInfo name="RFC" value="1034"/>
          <seriesInfo name="DOI" value="10.17487/RFC1034"/>
        </reference>
        <reference anchor="RFC1035" target="https://www.rfc-editor.org/info/rfc1035" quoteTitle="true" derivedAnchor="RFC1035">
          <front>
            <title>Domain names - implementation and specification</title>
            <author fullname="P. Mockapetris" initials="P." surname="Mockapetris"/>
            <date month="November" year="1987"/>
            <abstract>
              <t indent="0">This RFC is the revised specification of the protocol and format used in the implementation of the Domain Name System. It obsoletes RFC-883. This memo documents the details of the domain name client - server communication.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="13"/>
          <seriesInfo name="RFC" value="1035"/>
          <seriesInfo name="DOI" value="10.17487/RFC1035"/>
        </reference>
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" quoteTitle="true" derivedAnchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <abstract>
              <t indent="0">In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC3425" target="https://www.rfc-editor.org/info/rfc3425" quoteTitle="true" derivedAnchor="RFC3425">
          <front>
            <title>Obsoleting IQUERY</title>
            <author fullname="D. Lawrence" initials="D." surname="Lawrence"/>
            <date month="November" year="2002"/>
            <abstract>
              <t indent="0">The IQUERY method of performing inverse DNS lookups, specified in RFC 1035, has not been generally implemented and has usually been operationally disabled where it has been implemented. Both reflect a general view in the community that the concept was unwise and that the widely-used alternate approach of using pointer (PTR) queries and reverse-mapping records is preferable. Consequently, this document deprecates the IQUERY operation, declaring it entirely obsolete. This document updates RFC 1035. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="3425"/>
          <seriesInfo name="DOI" value="10.17487/RFC3425"/>
        </reference>
        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" quoteTitle="true" derivedAnchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <abstract>
              <t indent="0">RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
      </references>
      <references anchor="sec-informative-references" pn="section-7.2">
        <name slugifiedName="name-informative-references">Informative References</name>
        <reference anchor="RFC1996" target="https://www.rfc-editor.org/info/rfc1996" quoteTitle="true" derivedAnchor="RFC1996">
          <front>
            <title>A Mechanism for Prompt Notification of Zone Changes (DNS NOTIFY)</title>
            <author fullname="P. Vixie" initials="P." surname="Vixie"/>
            <date month="August" year="1996"/>
            <abstract>
              <t indent="0">This memo describes the NOTIFY opcode for DNS, by which a master server advises a set of slave servers that the master's data has been changed and that a query should be initiated to discover the new data. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="1996"/>
          <seriesInfo name="DOI" value="10.17487/RFC1996"/>
        </reference>
        <reference anchor="RFC2136" target="https://www.rfc-editor.org/info/rfc2136" quoteTitle="true" derivedAnchor="RFC2136">
          <front>
            <title>Dynamic Updates in the Domain Name System (DNS UPDATE)</title>
            <author fullname="P. Vixie" initials="P." role="editor" surname="Vixie"/>
            <author fullname="S. Thomson" initials="S." surname="Thomson"/>
            <author fullname="Y. Rekhter" initials="Y." surname="Rekhter"/>
            <author fullname="J. Bound" initials="J." surname="Bound"/>
            <date month="April" year="1997"/>
            <abstract>
              <t indent="0">Using this specification of the UPDATE opcode, it is possible to add or delete RRs or RRsets from a specified zone. Prerequisites are specified separately from update operations, and can specify a dependency upon either the previous existence or nonexistence of an RRset, or the existence of a single RR. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="2136"/>
          <seriesInfo name="DOI" value="10.17487/RFC2136"/>
        </reference>
        <reference anchor="RFC5936" target="https://www.rfc-editor.org/info/rfc5936" quoteTitle="true" derivedAnchor="RFC5936">
          <front>
            <title>DNS Zone Transfer Protocol (AXFR)</title>
            <author fullname="E. Lewis" initials="E." surname="Lewis"/>
            <author fullname="A. Hoenes" initials="A." role="editor" surname="Hoenes"/>
            <date month="June" year="2010"/>
            <abstract>
              <t indent="0">The standard means within the Domain Name System protocol for maintaining coherence among a zone's authoritative name servers consists of three mechanisms. Authoritative Transfer (AXFR) is one of the mechanisms and is defined in RFC 1034 and RFC 1035.</t>
              <t indent="0">The definition of AXFR has proven insufficient in detail, thereby forcing implementations intended to be compliant to make assumptions, impeding interoperability. Yet today we have a satisfactory set of implementations that do interoperate. This document is a new definition of AXFR -- new in the sense that it records an accurate definition of an interoperable AXFR mechanism. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="5936"/>
          <seriesInfo name="DOI" value="10.17487/RFC5936"/>
        </reference>
        <reference anchor="RFC7873" target="https://www.rfc-editor.org/info/rfc7873" quoteTitle="true" derivedAnchor="RFC7873">
          <front>
            <title>Domain Name System (DNS) Cookies</title>
            <author fullname="D. Eastlake 3rd" initials="D." surname="Eastlake 3rd"/>
            <author fullname="M. Andrews" initials="M." surname="Andrews"/>
            <date month="May" year="2016"/>
            <abstract>
              <t indent="0">DNS Cookies are a lightweight DNS transaction security mechanism that provides limited protection to DNS servers and clients against a variety of increasingly common denial-of-service and amplification/ forgery or cache poisoning attacks by off-path attackers. DNS Cookies are tolerant of NAT, NAT-PT (Network Address Translation - Protocol Translation), and anycast and can be incrementally deployed. (Since DNS Cookies are only returned to the IP address from which they were originally received, they cannot be used to generally track Internet users.)</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7873"/>
          <seriesInfo name="DOI" value="10.17487/RFC7873"/>
        </reference>
        <reference anchor="RFC8490" target="https://www.rfc-editor.org/info/rfc8490" quoteTitle="true" derivedAnchor="RFC8490">
          <front>
            <title>DNS Stateful Operations</title>
            <author fullname="R. Bellis" initials="R." surname="Bellis"/>
            <author fullname="S. Cheshire" initials="S." surname="Cheshire"/>
            <author fullname="J. Dickinson" initials="J." surname="Dickinson"/>
            <author fullname="S. Dickinson" initials="S." surname="Dickinson"/>
            <author fullname="T. Lemon" initials="T." surname="Lemon"/>
            <author fullname="T. Pusateri" initials="T." surname="Pusateri"/>
            <date month="March" year="2019"/>
            <abstract>
              <t indent="0">This document defines a new DNS OPCODE for DNS Stateful Operations (DSO). DSO messages communicate operations within persistent stateful sessions using Type Length Value (TLV) syntax. Three TLVs are defined that manage session timeouts, termination, and encryption padding, and a framework is defined for extensions to enable new stateful operations. This document updates RFC 1035 by adding a new DNS header OPCODE that has both different message semantics and a new result code. This document updates RFC 7766 by redefining a session, providing new guidance on connection reuse, and providing a new mechanism for handling session idle timeouts.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8490"/>
          <seriesInfo name="DOI" value="10.17487/RFC8490"/>
        </reference>
        <reference anchor="RFC8906" target="https://www.rfc-editor.org/info/rfc8906" quoteTitle="true" derivedAnchor="RFC8906">
          <front>
            <title>A Common Operational Problem in DNS Servers: Failure to Communicate</title>
            <author fullname="M. Andrews" initials="M." surname="Andrews"/>
            <author fullname="R. Bellis" initials="R." surname="Bellis"/>
            <date month="September" year="2020"/>
            <abstract>
              <t indent="0">The DNS is a query/response protocol. Failing to respond to queries, or responding incorrectly, causes both immediate operational problems and long-term problems with protocol development.</t>
              <t indent="0">This document identifies a number of common kinds of queries to which some servers either fail to respond or respond incorrectly. This document also suggests procedures for zone operators to apply to identify and remediate the problem.</t>
              <t indent="0">The document does not look at the DNS data itself, just the structure of the responses.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="231"/>
          <seriesInfo name="RFC" value="8906"/>
          <seriesInfo name="DOI" value="10.17487/RFC8906"/>
        </reference>
      </references>
    </references>
    <section anchor="Survey" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a">
      <name slugifiedName="name-guidance-for-the-use-of-qdc">Guidance for the Use of QDCOUNT in the DNS Specification</name>
      <t indent="0" pn="section-appendix.a-1">The DNS specification <xref target="RFC1035" format="default" sectionFormat="of" derivedContent="RFC1035"/> provides some guidance about the values of
QDCOUNT that are appropriate in various situations. A brief summary
of this guidance is collated below.</t>
      <section anchor="opcode-0-query-and-1-iquery" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.1">
        <name slugifiedName="name-opcode-0-query-and-1-iquery">OPCODE = 0 (QUERY) and 1 (IQUERY)</name>
        <t indent="0" pn="section-appendix.a.1-1"><xref target="RFC1035" format="default" sectionFormat="of" derivedContent="RFC1035"/> significantly predates the use of the normative requirement
key words specified in BCP 14 <xref target="RFC2119" format="default" sectionFormat="of" derivedContent="RFC2119"/> <xref target="RFC8174" format="default" sectionFormat="of" derivedContent="RFC8174"/>, and parts of it are consequently somewhat open to interpretation.</t>
        <t indent="0" pn="section-appendix.a.1-2">Section <xref target="RFC1035" sectionFormat="bare" section="4.1.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc1035#section-4.1.2" derivedContent="RFC1035">"Question section format"</xref> of <xref target="RFC1035" format="default" sectionFormat="of" derivedContent="RFC1035"/> states the following about QDCOUNT:</t>
        <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-appendix.a.1-3">
          <li pn="section-appendix.a.1-3.1">
            <t indent="0" pn="section-appendix.a.1-3.1.1">"The section contains QDCOUNT (usually 1) entries"</t>
          </li>
        </ul>
        <t indent="0" pn="section-appendix.a.1-4">The only documented exceptions within <xref target="RFC1035" format="default" sectionFormat="of" derivedContent="RFC1035"/> relate to the IQuery
OpCode, where the request has "an empty question section" (QDCOUNT = 0),
and the response has "zero, one, or multiple domain names for the
specified resource as QNAMEs in the question section". The IQuery OpCode
was obsoleted by <xref target="RFC3425" format="default" sectionFormat="of" derivedContent="RFC3425"/>.</t>
        <t indent="0" pn="section-appendix.a.1-5">In the absence of clearly expressed normative requirements, we rely on other text in <xref target="RFC1035" format="default" sectionFormat="of" derivedContent="RFC1035"/> that makes use of the definite article or that implies a singular question and, by implication, QDCOUNT = 1.</t>
        <t indent="0" pn="section-appendix.a.1-6">For example, <xref target="RFC1035" sectionFormat="of" section="4.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc1035#section-4.1" derivedContent="RFC1035"/> states the following:</t>
        <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-appendix.a.1-7">
          <li pn="section-appendix.a.1-7.1">
            <t indent="0" pn="section-appendix.a.1-7.1.1">"the question for the name server"</t>
          </li>
        </ul>
        <t indent="0" pn="section-appendix.a.1-8">and</t>
        <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-appendix.a.1-9">
          <li pn="section-appendix.a.1-9.1">
            <t indent="0" pn="section-appendix.a.1-9.1.1">"The question section contains fields that describe a question to a
name server."</t>
          </li>
        </ul>
        <t indent="0" pn="section-appendix.a.1-10">And per Section <xref target="RFC1035" sectionFormat="bare" section="4.1.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc1035#section-4.1.1" derivedContent="RFC1035">"Header section format"</xref> of <xref target="RFC1035" format="default" sectionFormat="of" derivedContent="RFC1035"/>:</t>
        <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-appendix.a.1-11">
          <li pn="section-appendix.a.1-11.1">
            <t indent="0" pn="section-appendix.a.1-11.1.1">"AA:  Authoritative Answer - this bit is valid in responses,
   and specifies that the responding name server is an
   authority for the domain name in question section."</t>
          </li>
        </ul>
        <t indent="0" pn="section-appendix.a.1-12">DNS Cookies (<xref target="RFC7873" sectionFormat="of" section="5.4" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7873#section-5.4" derivedContent="RFC7873"/>) allow a client to receive a valid Server Cookie without sending a specific question by sending
a request (QR = 0) with OPCODE = 0 and QDCOUNT = 0, with the resulting
	response also containing no question.</t>
        <t indent="0" pn="section-appendix.a.1-13">The DNS Zone Transfer Protocol (<xref target="RFC5936" sectionFormat="of" section="2.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc5936#section-2.2" derivedContent="RFC5936"/>) allows an authoritative server to optionally send a response message
(QR = 1) to a standard Authoritative Transfer (AXFR) query (OPCODE = 0, QTYPE=252) with
QDCOUNT = 0 in the second or subsequent message of a multi-message
response.</t>
      </section>
      <section anchor="opcode-4-notify" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.2">
        <name slugifiedName="name-opcode-4-notify">OPCODE = 4 (NOTIFY)</name>
        <t indent="0" pn="section-appendix.a.2-1">DNS Notify <xref target="RFC1996" format="default" sectionFormat="of" derivedContent="RFC1996"/> also lacks a clearly defined range of values
	for QDCOUNT.  Section <xref target="RFC1996" sectionFormat="bare" section="3.7" format="default" derivedLink="https://rfc-editor.org/rfc/rfc1996#section-3.7" derivedContent="RFC1996"/> states that:</t>
        <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-appendix.a.2-2">
          <li pn="section-appendix.a.2-2.1">
            <t indent="0" pn="section-appendix.a.2-2.1.1">"A NOTIFY request has QDCOUNT&gt;0"</t>
          </li>
        </ul>
        <t indent="0" pn="section-appendix.a.2-3">However, all other text in the RFC discusses the &lt;QNAME, QCLASS, QTYPE&gt;
tuple in the singular form.</t>
      </section>
      <section anchor="opcode-5-update" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.3">
        <name slugifiedName="name-opcode-5-update">OPCODE = 5 (UPDATE)</name>
        <t indent="0" pn="section-appendix.a.3-1">DNS Update <xref target="RFC2136" format="default" sectionFormat="of" derivedContent="RFC2136"/> renames the QDCOUNT field to ZOCOUNT, but
the value is constrained to be one by Section <xref target="RFC2136" sectionFormat="bare" section="2.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc2136#section-2.3" derivedContent="RFC2136">"Zone Section"</xref>:</t>
        <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-appendix.a.3-2">
          <li pn="section-appendix.a.3-2.1">
            <t indent="0" pn="section-appendix.a.3-2.1.1">"All records to be updated must be in the same zone, and therefore the
Zone Section is allowed to contain exactly one record."</t>
          </li>
        </ul>
      </section>
      <section anchor="opcode-6-dns-stateful-operations-dso" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.4">
        <name slugifiedName="name-opcode-6-dns-stateful-opera">OPCODE = 6 (DNS Stateful Operations, DSO)</name>
        <t indent="0" pn="section-appendix.a.4-1">DNS Stateful Operations (DSO) (OpCode 6) <xref target="RFC8490" format="default" sectionFormat="of" derivedContent="RFC8490"/>
preserves compatibility with the standard DNS 12-octet header by requiring all four of the section count values to be set to zero.</t>
      </section>
      <section anchor="conclusion" numbered="true" removeInRFC="false" toc="include" pn="section-appendix.a.5">
        <name slugifiedName="name-conclusion">Conclusion</name>
        <t indent="0" pn="section-appendix.a.5-1">There is no text in <xref target="RFC1035" format="default" sectionFormat="of" derivedContent="RFC1035"/> that describes how other parameters
in the DNS message, such as AA and RCODE, should be interpreted in the
case where a message includes more than one question. An originator
of a query with QDCOUNT &gt; 1 can have no expectations of how it will
be processed, and the receiver of a response with QDCOUNT &gt; 1 has
	no guidance for how it should be interpreted.</t>
        <t indent="0" pn="section-appendix.a.5-2">The allowable values of QDCOUNT seem to be clearly specified for
OPCODE = 4 (NOTIFY), OPCODE = 5 (UPDATE), and OPCODE = 6 (DNS Stateful
Operations, DSO). OPCODE = 1 (IQUERY) is obsolete and OPCODE = 2
(STATUS) is not specified. OPCODE = 3 is reserved.</t>
        <t indent="0" pn="section-appendix.a.5-3">However, the allowable values of QDCOUNT for OPCODE = 0 (QUERY) are
specified in <xref target="RFC1035" format="default" sectionFormat="of" derivedContent="RFC1035"/> without the clarity of normative language,
and this looseness of language results in some ambiguity.</t>
      </section>
    </section>
    <section anchor="acknowledgements" numbered="false" removeInRFC="false" toc="include" pn="section-appendix.b">
      <name slugifiedName="name-acknowledgements">Acknowledgements</name>
      <t indent="0" pn="section-appendix.b-1">The clarifications in this document were prompted by questions posed
by <contact fullname="Ted Lemon"/>, which reminded the authors of earlier, similar questions
and motivated them to pick up their pens. <contact fullname="Ondrej Sury"/>, <contact fullname="Warren Kumari"/>, <contact fullname="Peter Thomassen"/>, <contact fullname="Mark Andrews"/>, <contact fullname="Lars-Johan Liman"/>, <contact fullname="Jim Reid"/>, and <contact fullname="Niall O'Reilly"/> provided useful feedback.</t>
    </section>
    <section anchor="authors-addresses" numbered="false" removeInRFC="false" toc="include" pn="section-appendix.c">
      <name slugifiedName="name-authors-addresses">Authors' Addresses</name>
      <author initials="R." surname="Bellis" fullname="Ray Bellis">
        <organization abbrev="ISC" showOnFrontPage="true">Internet Systems Consortium, Inc.</organization>
        <address>
          <postal>
            <street>PO Box 360</street>
            <city>Newmarket</city>
            <region>NH</region>
            <code>03857</code>
            <country>United States of America</country>
          </postal>
          <phone>+1 650 423 1300</phone>
          <email>ray@isc.org</email>
        </address>
      </author>
      <author initials="J." surname="Abley" fullname="Joe Abley">
        <organization showOnFrontPage="true">Cloudflare</organization>
        <address>
          <postal>
            <city>Amsterdam</city>
            <country>Netherlands</country>
          </postal>
          <phone>+31 6 45 56 36 34</phone>
          <email>jabley@cloudflare.com</email>
        </address>
      </author>
    </section>
  </back>
</rfc>
