<?xml version="1.0" encoding="us-ascii"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.2.7 -->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC1035 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.1035.xml">
<!ENTITY RFC6891 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6891.xml">
<!ENTITY RFC2119 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC8174 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC2181 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2181.xml">
<!ENTITY RFC4034 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4034.xml">
<!ENTITY RFC5155 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5155.xml">
]>

<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>

<rfc ipr="trust200902" docName="draft-bellis-dnsext-multi-qtypes-05" category="std">

  <front>
    <title>DNS Multiple QTYPEs</title>

    <author initials="R." surname="Bellis" fullname="Ray Bellis">
      <organization abbrev="ISC">Internet Systems Consortium, Inc.</organization>
      <address>
        <postal>
          <street>950 Charter Street</street>
          <city>Redwood City</city>
          <code>CA 94063</code>
          <country>USA</country>
        </postal>
        <phone>+1 650 423 1200</phone>
        <email>ray@isc.org</email>
      </address>
    </author>

    <date year="2018" month="January" day="02"/>

    <area>Internet</area>
    <workgroup>DNSEXT Working Group</workgroup>
    <keyword>Internet-Draft</keyword>

    <abstract>


<t>This document specifies a method for a DNS client to request additional
DNS record types to be delivered alongside the primary record type
specified in the question section of a DNS query.</t>



    </abstract>


  </front>

  <middle>


<section anchor="introduction" title="Introduction">

<t>A commonly requested DNS <xref target="RFC1035"/> feature is the ability to receive
multiple related resource records (RRs) in a single DNS response.</t>

<t>For example, it may be desirable to receive both the A and AAAA
records for a domain name together, rather than having to issue
multiple queries.</t>

<t>The DNS wire protocol in theory supports having multiple questions in
a single packet, but in practise this does not work:</t>

<t><list style="symbols">
  <t>Each question consists of the tuple (QNAME, QTYPE, QCLASS).  Since
each question has its own QNAME field it would be possible for one
name to exist and another to not exist, resulting in an
inconsistent response code.</t>
  <t>The idea that only a single question is allowed is sufficiently
entrenched that many DNS servers will simply return an error (or
fail to response at all) if they receive a query with a question
count (QDCOUNT) of more than one.</t>
</list></t>

<t>To resolve both of these issues, this document constraints the
problem to those cases where only the QTYPE varies by specifying a
new option for the Extension Mechanisms for DNS (EDNS <xref target="RFC6891"/>) that
contains an additional list of QTYPE values that the client wishes to
receive in addition to that in the primary question.</t>

<t>TODO: why not "ANY" ?</t>

</section>
<section anchor="terminology-used-in-this-document" title="Terminology used in this document">

<t>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
<xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all
capitals, as shown here.</t>

</section>
<section anchor="description" title="Description">

<section anchor="multiple-qtype-edns-option-format" title="Multiple QTYPE EDNS Option Format">

<t>The overall format of an EDNS option is shown for reference below,
per <xref target="RFC6891"/>, followed by the option specific data:</t>

<figure><artwork><![CDATA[
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0: |                          OPTION-CODE                          |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
2: |                         OPTION-LENGTH                         |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
4: |                                                               |
   /                          OPTION-DATA                          /
   /                                                               /
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
]]></artwork></figure>

<t>OPTION-CODE: TBD by IANA</t>

<t>OPTION-LENGTH: Size (in octets) of OPTION-DATA.</t>

<t>OPTION-DATA: Option specific, as below:</t>

<figure><artwork><![CDATA[
                +0 (MSB)                            +1 (LSB)
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0: |QTD|   reserved    |  QTCOUNT  |           QT1 (MSB)           |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
2: |           QT1 (LSB)           |              ...              |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   |              ...             ///          QTn (MSB)           |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   |           QTn (LSB)           |
   +---+---+---+---+---+---+---+---+
]]></artwork></figure>

<t>QTD: this bit indicates the direction of the packet.  It MUST be clear
(0) in a query and set (1) in a response.</t>

<t>QTCOUNT: a 3 bit field with range 0 .. 7 specifying the number of QT
fields to follow.  NB: Whilst the QTCOUNT could in theory be calculated
based on the OPTION-LENGTH field, having it explicitly specified ensures
a sensible constraint its value.</t>

<t>QTn: a 2 byte field (MSB first) specifying a DNS RR type.  The RR type
MUST be for a real resource record, and MUST NOT refer to a pseudo RR
type such as "OPT", "IXFR", "TSIG", "*", etc.</t>

</section>
<section anchor="response-generation" title="Response Generation">

<section anchor="server-side-processing" title="Server Side Processing">

<t>A conforming server that receives a Multiple QTYPE Option in a query
MUST return a Multiple QTYPE Option in its response.</t>

<t>The QTD bit in that response MUST be set (1) as protection against
servers which simply echo unknown EDNS options verbatim.  If the QTD bit
in a response is zero the client MUST treat the response as if this
option is unsupported.</t>

<t>The server SHOULD attempt to return any resource records known to it
that match the additional (QNAME, QTn, QCLASS) tuples.  These records
MUST be returned in the Answer Section of the response, but the answer
for the primary QTYPE from the Question Section MUST be included first.</t>

<t>For any particular QTn in the query, if the server provides additional
answers, or has knowledge that the RR type type does not exist for that
QNAME (a "negative answer"), it must include that QTn value in the
Multiple QTYPE Option of its response.</t>

<t>A negative answer is therefore indicated by the combination of the
presence of a QTn value in the Multiple QTYPE Option and the absence of
a matching record in the Answer Section.  This is necessary (in the
absence of DNSSEC) to differentiate between absence of the record from
the zone and absence of the record from the response.</t>

<t>A server that is authoritative for the specified QNAME on receipt of a
Multiple QTYPE Option MUST attempt to return all specified RR types
except where that would result in truncation in which case it may omit
some (or all) of the records for the additional RR types.  Those RR
types MUST then also be omitted from the Multiple QTYPE Option in the
response.</t>

<t>A caching recursive server receiving a Multiple QTYPE Option SHOULD
attempt to fill its positive and negative caches with all of the
specified RR types before returning its response to the client.</t>

<t>TODO: is there a case for mandatory answers, i.e. the client saying I
<spanx style="emph">really</spanx> want all these?</t>

</section>
<section anchor="client-side-processing" title="Client Side Processing">

<t>Recursive resolvers MAY use this method to obtain multiple records from
an authoritative server.  For the purposes of Section 5.4.1 of
<xref target="RFC2181"/> any authoritative answers received MUST be ranked the same
as the answer for the primary question.</t>

</section>
<section anchor="dnssec" title="DNSSEC">

<t>If the DNS client sets the "DNSSEC OK" (DO) bit in the query then the
server MUST also return the related DNSSEC records that would have been
returned in a standalone query for the same QTYPE.</t>

<t>A negative answer from a signed zone MUST contain the appropriate
authenticated denial of existence records, per <xref target="RFC4034"/> and
<xref target="RFC5155"/>.</t>

<t>In a signed zone there is a theoretical risk of valid signatures for one
RR type and invalid signatures for another.  This is the only case known
to the author where the response code for any particular QNAME may be
inconsistent across different RR types.</t>

<t>Should a validating resolver produce NOERROR for some RR types and
SERVFAIL for others it MUST omit the RR types that failed to validate
from its response and from the QTn fields on the Multiple QTYPE option.
The client MAY then initiate standalone queries for those RR types.</t>

</section>
</section>
</section>
<section anchor="security-considerations" title="Security Considerations">

<t>The method documented here does not change any of the security
properties of the DNS protocol itself.</t>

<t>It should however be noted that this method does increase the potential
amplification factor when the DNS protocol is used as a vector for a
denial of service attack.</t>

</section>
<section anchor="iana-considerations" title="IANA Considerations">

<t>IANA is requested to assign a new value in the DNS EDNS0 Option Codes
registry.</t>

</section>
<section anchor="acknowledgements" title="Acknowledgements">

<t>The author wishes to thank the following for their feedback and reviews
during the initial development of this document: Michael Graff, Olafur
Gudmundsson, Matthijs Mekking, Paul Vixie.</t>

</section>


  </middle>

  <back>

    <references title='Normative References'>

&RFC1035;
&RFC6891;
&RFC2119;
&RFC8174;
&RFC2181;
&RFC4034;
&RFC5155;


    </references>




  </back>

<!-- ##markdown-source:
H4sIAM9PS1oAA71ZW3PbNhZ+x6/AOi92Iyl24rSNXrqK7aSeta1EUtrmqQOR
kIU1SbAAaEVt/d/3XACScuxuZjZdTWKJFIRz8J3vXDkcDkUwodBjeXo1l5dN
EUxdaPl+8fHdmRe5zSpVwpe5U6swXOqiMH6YV15/CsMSFw9/C9ta++HhSyFM
7cYyuMaH54eHrw6fC+W0GsvzKmhX6SA21yTl7JeF/Nm6G1Ndy7fONrW42XSr
hqcoSmQqjKUPuRCZzWHlWDZ+qHxmjKjNWEg5lMFm9O63pdMrz5+tC3QhVBPW
1tFK+C+lqfxYzkbyNZ2BbvHRZmrbv2nddaeMnG990KWXJ7bCrU1TDuDLbERL
1XLp9C2snp/QtQfRGtR+9fJQnqyVgz3knO7R15kJWxCn8421uTyBK75tc9Di
ZCJfHR9++yLeaqrgYPGH+YRu1GtbwaKnR/Jb2Pv4+Qt5BBDTV7pUphhLp7b/
ND4bgfpCDIdDUA7UUVkQYrE2XoIlm1JXQfpaZ2ZltJdKlhowyuXKOrhA+2eF
wTXBSqd/a7QPUuW5CcZWqhC4wOnMulySzXHZUstcF+ZWO51LVdjq2ptcy7DW
snamVG7b/4lIwnMwBy0iIbC99Dqjd7uKqsA3bjvis5QmzwstxBM0jLN5Q2uF
mABSZWmrYpv0hZ3xx3/88Y/Zm5Ojwxcv7+7kSqvQOC0BBRSplqYA7PmQmQbd
RZlo73ShcA+nvW1cpqPyXu7PZv4AlVbSAxthKaPhayCGBjXfAIb6kyphl4E0
QZbAKgLHG6eWsL4TJ5c2rEmViVRVLifwEkkQ2yK3YNWKCAo/vAYzaTcAG+M7
/FJVcq1u0X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