From: Peter van Dijk Date: Fri, 1 Apr 2016 10:33:49 +0000 (+0200) Subject: allow skipping DNS/UeberBackend lookup in FindNS X-Git-Tag: rec-4.0.0-alpha3~1^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a64269709c6476d6b6c133960536d19b9768ee7;p=thirdparty%2Fpdns.git allow skipping DNS/UeberBackend lookup in FindNS --- diff --git a/pdns/communicator.hh b/pdns/communicator.hh index 24f9f02367..b4356d9add 100644 --- a/pdns/communicator.hh +++ b/pdns/communicator.hh @@ -220,12 +220,13 @@ public: this->resolve_name(&addresses, name); - b->lookup(QType(QType::ANY),name); - DNSResourceRecord rr; - while(b->get(rr)) - if(rr.qtype.getCode() == QType::A || rr.qtype.getCode()==QType::AAAA) - addresses.push_back(rr.content); // SOL if you have a CNAME for an NS - + if(b) { + b->lookup(QType(QType::ANY),name); + DNSResourceRecord rr; + while(b->get(rr)) + if(rr.qtype.getCode() == QType::A || rr.qtype.getCode()==QType::AAAA) + addresses.push_back(rr.content); // SOL if you have a CNAME for an NS + } return addresses; } @@ -235,12 +236,13 @@ public: this->resolve_name(&addresses, name); - b->lookup(QType(QType::ANY),name); - DNSResourceRecord rr; - while(b->get(rr)) - if(rr.qtype.getCode() == QType::A || rr.qtype.getCode()==QType::AAAA) - addresses.push_back(rr.content); // SOL if you have a CNAME for an NS - + if(b) { + b->lookup(QType(QType::ANY),name); + DNSResourceRecord rr; + while(b->get(rr)) + if(rr.qtype.getCode() == QType::A || rr.qtype.getCode()==QType::AAAA) + addresses.push_back(rr.content); // SOL if you have a CNAME for an NS + } return addresses; }