[Pdns-dev] Explicit Notification

Markus Lauer mlauer at key-systems.net
Thu Dec 9 23:00:18 CET 2010


Prove of concept patch

Can be patched into pdns-2-9-22 and trunk (by changing pdns/communicator.cc to 
pdns/mastercommunicator.cc):

pdns-2-9-22 $ patch -p0 < pdns.patch

Add the following line into your config file:

explicit-notify-ips=127.0.0.2


Now only your 'explicit-notify-ips' receive a notify.


Comments appreciated!



Index: pdns/communicator.cc
===================================================================
--- pdns/communicator.cc        (Revision 1746)
+++ pdns/communicator.cc        (Arbeitskopie)
@@ -148,7 +148,17 @@
 void CommunicatorClass::queueNotifyDomain(const string &domain, DNSBackend 
*B)
 {
   set<string> ips;
-  
+
+  if(!::arg()["explicit-notify-ips"].empty())
+  {
+    vector<string> parts;
+    stringtok( parts, ::arg()["explicit-notify-ips"], ", \t" );
+    for( vector<string>::const_iterator i = parts.begin(); i != parts.end(); 
++i ) {
+      ips.insert(*i);
+    }   
+  }
+  else
+  {
   DNSResourceRecord rr;
   set<string>nsset;
 
@@ -163,6 +173,7 @@
     for(vector<string>::const_iterator k=nsips.begin();k!=nsips.end();++k)
       ips.insert(*k);
   }
+  }
   
   // make calls to d_nq.add(domain, ip);
   for(set<string>::const_iterator j=ips.begin();j!=ips.end();++j) {
Index: pdns/common_startup.cc
===================================================================
--- pdns/common_startup.cc      (Revision 1746)
+++ pdns/common_startup.cc      (Arbeitskopie)
@@ -80,6 +80,7 @@
   ::arg().set("launch","Which backends to launch and order to query them 
in")="";
   ::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";
+  ::arg().set("explicit-notify-ips","Override NS records and notify explicit 
ips")="";
   ::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")="";




More information about the Pdns-dev mailing list