]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
add also-notify option
authorKees Monshouwer <mind04@monshouwer.org>
Sat, 28 Dec 2013 19:24:12 +0000 (20:24 +0100)
committermind04 <mind04@monshouwer.org>
Sat, 28 Dec 2013 21:58:45 +0000 (22:58 +0100)
fixes #949

pdns/common_startup.cc
pdns/communicator.cc
pdns/communicator.hh
pdns/docs/pdns.xml
pdns/mastercommunicator.cc
pdns/pdns.conf-dist

index 9d8d1f09a9922f202e1227dd55b22983ad9b1f93..7adabc21a766c1d3b6661b773db73752261add67 100644 (file)
@@ -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")="";
index 09323056e8bffbe7011a4d19db5df0c3490fa47e..1a9ad891aeac325a31c74217b713755d51b94748 100644 (file)
@@ -64,6 +64,11 @@ void CommunicatorClass::go()
 
   d_preventSelfNotification = ::arg().mustDo("prevent-self-notification");
   d_onlyNotify.toMasks(::arg()["only-notify"]);
+
+  vector<string> parts;
+  stringtok(parts, ::arg()["also-notify"], ", \t");
+  for (vector<string>::const_iterator iter = parts.begin(); iter != parts.end(); ++iter)
+    d_alsoNotify.insert(*iter);
 }
 
 void CommunicatorClass::mainloop(void)
index 8e1910f308e7dd1212e3e726c873b3c7190f69ef..dd03022b6f4db1417ed0fc698b35b9ee72d5c91b 100644 (file)
@@ -203,7 +203,7 @@ private:
   vector<DNSPacket> d_potentialsupermasters;
   bool d_preventSelfNotification;
   NetmaskGroup d_onlyNotify;
-
+  set<string> d_alsoNotify;
 };
 
 #endif
index 224cf61c844ba3e3fc067bd27b7d6d9c94e3a87f..85e4ec8585a5aa1efc5d98e777c40ad3f7c2868a 100644 (file)
@@ -15852,7 +15852,16 @@ To enable a Lua script for a particular slave zone, determine the domain_id for
              By specifying <command>allow-recursion</command>, recursion can be restricted to netmasks specified. The default is to allow
              recursion from everywhere. Example: <command>allow-recursion=192.168.0.0/24, 10.0.0.0/8, 192.0.2.4</command>.
            </para>
-         </listitem></varlistentry>
+         </listitem>
+       </varlistentry>
+       <varlistentry>
+         <term>also-notify=...</term>
+         <listitem>
+           <para>
+             When notifying a domain, also notify these nameservers. Example: <command>also-notify=192.168.0.1, 10.0.0.1</command>.
+           </para>
+         </listitem>
+       </varlistentry>
          <varlistentry><term>any-to-tcp | any-to-tcp=yes | any-to-tcp=no</term>
            <listitem><para>
                Answer questions for the ANY and RRSIG types on UDP with a truncated packet that refers the
index 2b2e8b52abb91fc7afb4950f0202a41c14b85bec..61e79ca2fccd760e19f621e13acd97ceeceaa2e0 100644 (file)
@@ -74,14 +74,16 @@ void CommunicatorClass::queueNotifyDomain(const string &domain, DNSBackend *B)
     hasQueuedItem=true;
   }
 
-  set<string>alsoNotify;
+  set<string> alsoNotify(d_alsoNotify);
   B->alsoNotifies(domain, &alsoNotify);
 
   for(set<string>::const_iterator j=alsoNotify.begin();j!=alsoNotify.end();++j) {
     const ComboAddress caIp(*j, 53);
     L<<Logger::Warning<<"Queued also-notification of domain '"<<domain<<"' to "<<caIp.toStringWithPort()<<endl;
-    if (!ips.count(caIp.toStringWithPort()))
+    if (!ips.count(caIp.toStringWithPort())) {
+      ips.insert(caIp.toStringWithPort());
       d_nq.add(domain, caIp.toStringWithPort());
+    }
     hasQueuedItem=true;
   }
 
index 75ddc76ae4926712585c33244cb3a2204aac5a2f..562caf1e07b4391be052dda563260ec84785d046 100644 (file)
 #
 # allow-recursion=0.0.0.0/0
 
+#################################
+# also-notify  When notifying a domain, also notify these nameservers
+#
+# also-notify=
+
 #################################
 # any-to-tcp   Answer ANY queries with tc=1, shunting to TCP
 #