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: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F5037%2Fhead;p=thirdparty%2Fpdns.git 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 ec3358795f..75ae261df3 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);