From: Remi Gacogne Date: Wed, 15 Feb 2017 08:30:00 +0000 (+0100) Subject: dnsdist: Don't cache ServFail / Refused if the TTL is set to 0 X-Git-Tag: rec-4.1.0-alpha1~264^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f4e5b47dfc6633fd1af439fd22bc3634d7c6cb15;p=pdns dnsdist: Don't cache ServFail / Refused if the TTL is set to 0 --- diff --git a/pdns/dnsdist-cache.cc b/pdns/dnsdist-cache.cc index ec3358795..75ae261df 100644 --- a/pdns/dnsdist-cache.cc +++ b/pdns/dnsdist-cache.cc @@ -53,6 +53,9 @@ void DNSDistPacketCache::insert(uint32_t key, const DNSName& qname, uint16_t qty if (rcode == RCode::ServFail || rcode == RCode::Refused) { minTTL = d_tempFailureTTL; + if (minTTL == 0) { + return; + } } else { minTTL = getMinTTL(response, responseLen);