diff --git a/pdns/mastercommunicator.cc b/pdns/mastercommunicator.cc index 8135bf955b56..282971775828 100644 --- a/pdns/mastercommunicator.cc +++ b/pdns/mastercommunicator.cc @@ -44,42 +44,48 @@ void CommunicatorClass::queueNotifyDomain(const string &domain, DNSBackend *B) { bool hasQueuedItem=false; - set ips; - FindNS fns; - + set nsset, ips; DNSResourceRecord rr; - set nsset; + FindNS fns; + B->lookup(QType(QType::NS),domain); - while(B->get(rr)) + while(B->get(rr)) nsset.insert(rr.content); - + for(set::const_iterator j=nsset.begin();j!=nsset.end();++j) { vector nsips=fns.lookup(*j, B); if(nsips.empty()) L<::const_iterator k=nsips.begin();k!=nsips.end();++k) - ips.insert(*k); + else + for(vector::const_iterator k=nsips.begin();k!=nsips.end();++k) { + const ComboAddress caIp(*k, 53); + if(!d_preventSelfNotification || !AddressIsUs(caIp)) + ips.insert(caIp.toStringWithPort()); + } } - - // make calls to d_nq.add(domain, ip); + for(set::const_iterator j=ips.begin();j!=ips.end();++j) { L<alsoNotify; B->alsoNotifies(domain, &alsoNotify); - + for(set::const_iterator j=alsoNotify.begin();j!=alsoNotify.end();++j) { - L<