From 24d3239e69823c5e28abc63234e8276c3d7cb9a5 Mon Sep 17 00:00:00 2001 From: Kees Monshouwer Date: Sat, 28 Dec 2013 20:24:12 +0100 Subject: [PATCH] add also-notify option fixes #949 --- pdns/common_startup.cc | 1 + pdns/communicator.cc | 5 +++++ pdns/communicator.hh | 2 +- pdns/docs/pdns.xml | 11 ++++++++++- pdns/mastercommunicator.cc | 6 ++++-- pdns/pdns.conf-dist | 5 +++++ 6 files changed, 26 insertions(+), 4 deletions(-) diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index 9d8d1f09a..7adabc21a 100644 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -93,6 +93,7 @@ void declareArguments() ::arg().setSwitch("disable-axfr","Disable zonetransfers but do allow TCP queries")="no"; ::arg().set("allow-axfr-ips","Allow zonetransfers only to these subnets")="0.0.0.0/0,::/0"; ::arg().set("only-notify", "Only send AXFR NOTIFY to these IP addresses or netmasks")="0.0.0.0/0,::/0"; + ::arg().set("also-notify", "When notifying a domain, also notify these nameservers")=""; ::arg().set("slave-cycle-interval","Reschedule failed SOA serial checks once every .. seconds")="60"; ::arg().set("tcp-control-address","If set, PowerDNS can be controlled over TCP on this address")=""; diff --git a/pdns/communicator.cc b/pdns/communicator.cc index 09323056e..1a9ad891a 100644 --- a/pdns/communicator.cc +++ b/pdns/communicator.cc @@ -64,6 +64,11 @@ void CommunicatorClass::go() d_preventSelfNotification = ::arg().mustDo("prevent-self-notification"); d_onlyNotify.toMasks(::arg()["only-notify"]); + + vector parts; + stringtok(parts, ::arg()["also-notify"], ", \t"); + for (vector::const_iterator iter = parts.begin(); iter != parts.end(); ++iter) + d_alsoNotify.insert(*iter); } void CommunicatorClass::mainloop(void) diff --git a/pdns/communicator.hh b/pdns/communicator.hh index 8e1910f30..dd03022b6 100644 --- a/pdns/communicator.hh +++ b/pdns/communicator.hh @@ -203,7 +203,7 @@ private: vector d_potentialsupermasters; bool d_preventSelfNotification; NetmaskGroup d_onlyNotify; - + set d_alsoNotify; }; #endif diff --git a/pdns/docs/pdns.xml b/pdns/docs/pdns.xml index 224cf61c8..85e4ec858 100644 --- a/pdns/docs/pdns.xml +++ b/pdns/docs/pdns.xml @@ -15852,7 +15852,16 @@ To enable a Lua script for a particular slave zone, determine the domain_id for By specifying allow-recursion, recursion can be restricted to netmasks specified. The default is to allow recursion from everywhere. Example: allow-recursion=192.168.0.0/24, 10.0.0.0/8, 192.0.2.4. - + + + + also-notify=... + + + When notifying a domain, also notify these nameservers. Example: also-notify=192.168.0.1, 10.0.0.1. + + + any-to-tcp | any-to-tcp=yes | any-to-tcp=no Answer questions for the ANY and RRSIG types on UDP with a truncated packet that refers the diff --git a/pdns/mastercommunicator.cc b/pdns/mastercommunicator.cc index 2b2e8b52a..61e79ca2f 100644 --- a/pdns/mastercommunicator.cc +++ b/pdns/mastercommunicator.cc @@ -74,14 +74,16 @@ void CommunicatorClass::queueNotifyDomain(const string &domain, DNSBackend *B) hasQueuedItem=true; } - setalsoNotify; + set alsoNotify(d_alsoNotify); B->alsoNotifies(domain, &alsoNotify); for(set::const_iterator j=alsoNotify.begin();j!=alsoNotify.end();++j) { const ComboAddress caIp(*j, 53); L<