From: Otto Moerbeek Date: Tue, 3 Jan 2023 08:24:05 +0000 (+0100) Subject: Make a distinction between "ordinary" negcache results and entire name results. X-Git-Tag: dnsdist-1.8.0-rc1~142^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F12334%2Fhead;p=thirdparty%2Fpdns.git Make a distinction between "ordinary" negcache results and entire name results. --- diff --git a/pdns/recursordist/syncres.cc b/pdns/recursordist/syncres.cc index db98619514..5acacf5652 100644 --- a/pdns/recursordist/syncres.cc +++ b/pdns/recursordist/syncres.cc @@ -2822,13 +2822,15 @@ bool SyncRes::doCacheCheck(const DNSName& qname, const DNSName& authname, bool w if (ne.d_qtype.getCode()) { LOG(prefix << qname << ": " << qtype << " is negatively cached via '" << ne.d_auth << "' for another " << sttl << " seconds" << endl); res = RCode::NoError; + if (s_addExtendedResolutionDNSErrors) { + context.extendedError = EDNSExtendedError{0, "Result from negative cache"}; + } } else { LOG(prefix << qname << ": Entire name '" << qname << "' is negatively cached via '" << ne.d_auth << "' for another " << sttl << " seconds" << endl); - } - if (s_addExtendedResolutionDNSErrors) { - // XXX Do we want this? - context.extendedError = EDNSExtendedError{0, "Result from negative cache"}; + if (s_addExtendedResolutionDNSErrors) { + context.extendedError = EDNSExtendedError{0, "Result from negative cache for entire name"}; + } } } }