]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Don't chace CNAMEs for NS queries
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 25 Sep 2023 10:38:34 +0000 (12:38 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 25 Sep 2023 10:38:34 +0000 (12:38 +0200)
Also, if we encouter a NS record without associated address records,
wipe it from cache. This latest part is not well tested yet and might have
bad side effects.

pdns/recursordist/syncres.cc

index 2a5b46ae4eb395a13b28b2774a55518936b4ced6..0e4822bedeecfc64bd6ce4a2fc6055f588287d67 100644 (file)
@@ -2078,7 +2078,7 @@ vector<ComboAddress> SyncRes::getAddrs(const DNSName& qname, unsigned int depth,
   const unsigned int startqueries = d_outqueries;
   d_requireAuthData = false;
   d_DNSSECValidationRequested = false;
-  d_followCNAME = true;
+  d_followCNAME = false;
 
   MemRecursorCache::Flags flags = MemRecursorCache::None;
   if (d_serveStale) {
@@ -2269,6 +2269,7 @@ void SyncRes::getBestNSFromCache(const DNSName& qname, const QType qtype, vector
           else {
             *flawedNSSet = true;
             LOG(prefix << qname << ": NS in cache for '" << subdomain << "', but needs glue (" << nrr->getNS() << ") which we miss or is expired" << endl);
+            g_recCache->doWipeCache(subdomain, false, QType::NS);
           }
         }
       }