<?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-homburg-dnsop-dettl-00" submissionType="IETF" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" updates="9520" indexInclude="true" consensus="true">

<front>
<title abbrev="dettl">Add TTLs to DNS errors</title><seriesInfo value="draft-homburg-dnsop-dettl-00" stream="IETF" status="standard" name="Internet-Draft"></seriesInfo>
<author initials="P.C." surname="Homburg" fullname="Philip Homburg"><organization></organization><address><postal><street></street>
</postal><email>philip@nlnetlabs.nl</email>
</address></author><date/>
<area>Internet</area>
<workgroup>DNSOP</workgroup>

<abstract>
<t>When a DNS server replies an error other than NXDOMAIN, there is no mechanism
to specify how long this error can be cached by the recepient.
This document introduces a mechanism where a server can specify the time to
live (TTL) of an error by adding a SOA record to the additional section of
a reply.
Clients can use this TTL at their discretion. In particular, clients can
limit the TTL to a maximum value, impose a minimum value or just ignore the
TTL value all together.</t>
</abstract>

</front>

<middle>

<section anchor="discussion-venues"><name>Discussion Venues</name>
<t>This note is to be removed before publishing as an RFC.
Source for this draft and an issue tracker can be found at
<eref target="https://codeberg.org/NLnetLabs/draft-homburg-dnsop-dettl">https://codeberg.org/NLnetLabs/draft-homburg-dnsop-dettl</eref> .</t>
</section>

<section anchor="introduction"><name>Introduction</name>
<t>Typically, caching of errors other than NXDOMAIN is conservative compared to
caching of other DNS replies.
<xref target="RFC9520"></xref>,
<xref target="RFC9520" sectionFormat="bare" relative="#" section="Section 3.2"></xref>,
requires that errors such as SERVFAIL be cached for
at least 1 second and at most 5 minutes.
The effect of this is that if all nameservers of a DNS zone experience an
error and start replying SERVFAIL, then the load on those servers increases.
This may prevent or delay recovery from such a condition.</t>
<t>This also prevents introduction of new protocol elements where authoritative
servers intenionally return a SERVFAIL for certain queries.</t>
<t>Similar effects occur between a stub-resolver and a recursive resolver.
When a DNSSEC validating resolver returns SERVFAIL as a result of a DNSSEC
validation error, it may know (based on the TTLs of the RRsets that cause
the error) how long this error can be cached.</t>
<t>Another example is a proposal to use a delegation to the root (NS .) to
indicate that a name exists but is not served by any name servers.
A recursive resolver can return SERVFAIL for such names and knows (based
on the TTL of the NS RRset or the negative replies for the A and AAAA queries)
how long the SERVFAIL can be cached.</t>
</section>

<section anchor="server-behavior"><name>Server behavior</name>
<t>When a DNS server replies with an error other than NXDOMAIN, the server
should add a SOA record to the additional section of the reply.
In this case, the server SHOULD keep the Answer and Authority sections
empty and the SOA record SHOULD be the first record of the additional section.</t>
<t>The SOA record MUST have &quot;_error_ttl.&quot; as owner name, and as TTL the time to
live of the error.
MNAME and RNAME SHOULD be set to &quot;.&quot;.
SERIAL, REFRESH, RETRY, and EXPIRE SHOULD be set to 0.
For compatibility with existing SOA processing for NXDOMAIN and NODATA,
the MINIMUM field SHOULD be set to the TTL of the SOA record.</t>
</section>

<section anchor="client-behavior"><name>Client behavior</name>
<t>A DNS client MAY take a TTL as specified in this document into account or
follow the behavior outlined in RFC 9520.
This document updates RFC 9520 in that a client that uses a TTL as described
in this document may exceed the 5 minute limit.</t>
<t>A client MAY stop the processing described in this draft if the Answer and
Authority sections are not empty or if the first record in the Additional
section is not a SOA record.</t>
<t>Clients should take care to limit TTL values.
The TTL value cannot be protected using DNSSEC.
With insecure transports, an attacker can spoof an error reply with a high
TTL. Client may also impose a minimum value. This minimum SHOULD be less than
5 minutes.</t>
</section>

<section anchor="iana-considerations"><name>IANA Considerations</name>
<t>Per <xref target="RFC8552"></xref>, IANA is directed to add the following entry to the DNS Underscore Global Scoped Entry Registry:</t>
<table>
<thead>
<tr>
<th>RR TYPE</th>
<th>_NODE NAME</th>
<th align="right">Reference</th>
</tr>
</thead>

<tbody>
<tr>
<td>SOA</td>
<td>_error_ttl</td>
<td align="right">(This document)</td>
</tr>
</tbody>
</table></section>

<section anchor="security-considerations"><name>Security Considerations</name>
<t>This document addresses the issue that a nameserver that return errors other
than NXDOMAIN will often see client cache responses for a much shorter time
than typical resposenses.
This increases the load of the nameserver and may result in generally
lower performance or availablity of the service.</t>
<t>In particular if the errors are returned due to a failure, this increase load
may make it harder to recover from failures. This document makes it possible
that servers and clients coordinate to keep the load at reasonable levels.</t>
</section>

</middle>

<back>
<references><name>Informative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8552.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9520.xml"/>
</references>

</back>

</rfc>
