]> granicus.if.org Git - pdns/commitdiff
the ever vigilant Imre Gergely spotted that PowerDNS tries to reprime its root hints...
authorBert Hubert <bert.hubert@netherlabs.nl>
Sun, 28 Feb 2010 13:47:56 +0000 (13:47 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Sun, 28 Feb 2010 13:47:56 +0000 (13:47 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1531 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/syncres.cc

index c1bcb3626b4a14f58d4c17f912171815a816b932..fb8bba57a9bb38854bfb93fe773cca677d7b9369 100644 (file)
@@ -405,8 +405,15 @@ int SyncRes::doResolve(const string &qname, const QType &qtype, vector<DNSResour
     subdomain=getBestNSNamesFromCache(subdomain, nsset, &flawedNSSet, depth, beenthere); //  pass beenthere to both occasions
 
     if(nsset.empty()) { // must've lost root records
-      LOG<<prefix<<qname<<": our root expired, repriming from hints and retrying"<<endl;
-      primeHints();
+      set<DNSResourceRecord> rootset;
+      /* this additional test is needed since getBestNSNamesFromCache sometimes returns that no
+         useful NS records were found, even without the root being expired. This might for example
+         be the case when the . records are not acceptable because they are part of a loop, a loop
+         caused by the invalidation of an nsset during the resolution algorithm */
+      if(t_RC->get(d_now.tv_sec, ".", QType(QType::NS), &rootset) <= 0) {
+        L<<Logger::Warning<<prefix<<qname<<": our root expired, repriming from hints and retrying"<<endl;
+        primeHints();
+      }
     }
   }