From: Otto Moerbeek Date: Fri, 8 Oct 2021 05:35:32 +0000 (+0200) Subject: Condition covering NoError, NXDomain and missing records properly X-Git-Tag: dnsdist-1.7.0-alpha2~19^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99c2bf54d0a2efbd69bcd9e4091f27bd7211cbfc;p=thirdparty%2Fpdns.git Condition covering NoError, NXDomain and missing records properly Co-authored-by: Remi Gacogne --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index f838e23e7e..38860b4070 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -2300,7 +2300,8 @@ 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 && hdr->rcode != RCode::NXDomain) { + if ((hdr->rcode != RCode::NoError && hdr->rcode != RCode::NXDomain) || + (hdr->ancount == 0 && hdr->nscount == 0)) { minTTL = min(minTTL, SyncRes::s_packetcacheservfailttl); } minTTL = min(minTTL, SyncRes::s_packetcachettl);