]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Do not consider an NXDomain reply an error
authorOtto <otto.moerbeek@open-xchange.com>
Tue, 5 Oct 2021 11:44:15 +0000 (13:44 +0200)
committerOtto <otto.moerbeek@open-xchange.com>
Tue, 5 Oct 2021 11:44:15 +0000 (13:44 +0200)
pdns/pdns_recursor.cc
pdns/recursordist/docs/settings.rst

index 214a20d5d5e655e5f9ea0eeb5251a60643b479a2..f838e23e7ea5d0b3ad247aa507b514e7f890eaf8 100644 (file)
@@ -2300,7 +2300,7 @@ static void startDoResolve(void *p)
     }
     if (!SyncRes::s_nopacketcache && !variableAnswer && !sr.wasVariable()) {
       const auto& hdr = pw.getHeader();
-      if (hdr->ancount == 0 && hdr->rcode != RCode::NoError) {
+      if (hdr->ancount == 0 && hdr->rcode != RCode::NoError && hdr->rcode != RCode::NXDomain) {
         minTTL = min(minTTL, SyncRes::s_packetcacheservfailttl);
       }
       minTTL = min(minTTL, SyncRes::s_packetcachettl);
index b7433d9ddaad12a357aee704bab9976fe88fcc7a..67a5316ab4cbebc7597d4dc89ef1a4286c604dc5 100644 (file)
@@ -1414,6 +1414,7 @@ Maximum number of seconds to cache an item in the packet cache, no matter what t
 -  Default: 60
 
 Maximum number of seconds to cache a 'server failure' and other answers signalling an error in the packet cache.
+Before version 4.6.0 only ``ServFail`` answers were considered an error. Starting with 4.6.0, any answer without answers records and rcode other than ``NoError`` and ``NXDomain`` are considered errors.
 
 .. versionchanged:: 4.0.0