From f4e5b47dfc6633fd1af439fd22bc3634d7c6cb15 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Wed, 15 Feb 2017 09:30:00 +0100 Subject: [PATCH] dnsdist: Don't cache ServFail / Refused if the TTL is set to 0 --- pdns/dnsdist-cache.cc | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.40.0