From: Otto Date: Tue, 5 Oct 2021 11:44:15 +0000 (+0200) Subject: Do not consider an NXDomain reply an error X-Git-Tag: dnsdist-1.7.0-alpha2~19^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=903cc83b00a3972f3856a8438bb24d0deb9294fd;p=thirdparty%2Fpdns.git Do not consider an NXDomain reply an error --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 214a20d5d5..f838e23e7e 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -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); diff --git a/pdns/recursordist/docs/settings.rst b/pdns/recursordist/docs/settings.rst index b7433d9dda..67a5316ab4 100644 --- a/pdns/recursordist/docs/settings.rst +++ b/pdns/recursordist/docs/settings.rst @@ -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