From 2a64269709c6476d6b6c133960536d19b9768ee7 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Fri, 1 Apr 2016 12:33:49 +0200 Subject: [PATCH] allow skipping DNS/UeberBackend lookup in FindNS --- pdns/communicator.hh | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) 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; } -- 2.47.2