From: Kees Monshouwer Date: Sat, 28 Dec 2013 19:24:12 +0000 (+0100) Subject: add also-notify option X-Git-Tag: rec-3.6.0-rc1~263^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24d3239e69823c5e28abc63234e8276c3d7cb9a5;p=thirdparty%2Fpdns.git add also-notify option fixes #949 --- diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index 9d8d1f09a9..7adabc21a7 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 09323056e8..1a9ad891ae 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 8e1910f308..dd03022b6f 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 224cf61c84..85e4ec8585 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 2b2e8b52ab..61e79ca2fc 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<