<div dir="ltr"><div>Fred,</div><div><br></div><div>Most of the details are in RFC 2308 (Negative Caching of DNS Queries).</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Apr 6, 2024 at 9:16 AM Fred Morris <<a href="mailto:m3047@m3047.net">m3047@m3047.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">So the answer is in two parts.<br>
<br>
1) An SOA record is required in the AUTHORITY section. The TTL on the <br>
negative answer is established by the TTL on this record.<br>
<br>
2) "TTL on this record" means the literal TTL applied to the SOA record, <br>
not e.g. the minimum TTL specified within the SOA record.</blockquote><div><br></div><div>Yes, from the resolver's point of view - it just needs to use the SOA record's</div><div>TTL itself to countdown (or bound) the negative response in its cache.</div><div><br></div><div>However, the authoritative server providing the negative response does</div><div>need to set the SOA's TTL to be the minimum of the SOA MINIMUM field</div><div>and the TTL of the SOA itself.</div><div><br></div>Relevant text from RFC 2308 DNS Negative Caching<br><br>3 - Negative Answers from Authoritative Servers<br><br> Name servers authoritative for a zone MUST include the SOA record of<br> the zone in the authority section of the response when reporting an<br> NXDOMAIN or indicating that no data of the requested type exists.<br> This is required so that the response may be cached. The TTL of this<br> record is set from the minimum of the MINIMUM field of the SOA record<br> and the TTL of the SOA itself, and indicates how long a resolver may<br> cache the negative answer. The TTL SIG record associated with the<br> SOA record should also be trimmed in line with the SOA's TTL.<br><br> If the containing zone is signed [RFC2065] the SOA and appropriate<br> NXT and SIG records MUST be added.</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">> I'd also appreciate (from someone who's read the code) a statement of<br>> what the intended semantics are, before I go read the code myself.<br>> Presuming that the ANSWER:0 response is authoritative, is there any<br>> expectation regarding content in the ADDITIONAL or AUTHORITATIVE<br>> sections which affects this behavior? NS? SOA?</div><div class="gmail_quote"><br></div><div class="gmail_quote">Only the SOA in the Authority is required. And if the response is from a</div><div class="gmail_quote">signed zone, the SOA signature, and the relevant signed NSEC/NSEC3</div><div class="gmail_quote">records that prove non-existence of the name or type are required too.</div><div class="gmail_quote"><br></div><div class="gmail_quote">NS and any nameserver addresses are optional (and are less often seen</div><div class="gmail_quote">these days since many nameserver operators use a minimal response</div><div class="gmail_quote">configuration that omits optional data).</div><div class="gmail_quote"><div> </div><div>Shumon.</div><div><br></div></div></div>