]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: SLAVE-RENOTIFY zone metadata support
authorMatti Hiljanen <matti@hiljanen.com>
Tue, 25 Jun 2019 10:51:41 +0000 (13:51 +0300)
committerMatti Hiljanen <matti@hiljanen.com>
Tue, 25 Jun 2019 14:07:49 +0000 (17:07 +0300)
docs/domainmetadata.rst
docs/settings.rst
pdns/slavecommunicator.cc

index 926628037ff7ca33a8c6efeda30433bce4eb096c..59705615ab790cf788b0f851b381f4bc06524b43 100644 (file)
@@ -172,6 +172,16 @@ This metadata can also be set using the
 and ``set-publish-cds``. For an example for an :rfc:`7344` key rollover,
 see the :doc:`guides/kskrollcdnskey`.
 
+.. _metadata-slave-renotify:
+
+SLAVE-RENOTIFY
+--------------
+.. versionadded:: 4.3.0
+
+If set to 1, will make PowerDNS renotify the slaves after an AXFR is received from a master.
+Any other value means that no renotifies are done. If not set at all, action will depend on
+the :ref:`setting-slave-renotify` setting.
+
 .. _metadata-soa-edit:
 
 SOA-EDIT
index 3c00056cfdacafff081fc7803edc6446c87cc51b..94f518ebabb47c106bf316d3101f3467acabda7b 100644 (file)
@@ -1404,6 +1404,8 @@ This setting will make PowerDNS renotify the slaves after an AXFR is
 *received* from a master. This is useful when using when running a
 signing-slave.
 
+See :ref:`metadata-slave-renotify` to set this per-zone.
+
 .. _setting-soa-expire-default:
 
 ``soa-expire-default``
index 53b66197c320521a7378cc98ce37bcf422c84ae5..46e4c8f15de94f77651e114f3cf0b60604d04315 100644 (file)
@@ -599,7 +599,19 @@ void CommunicatorClass::suck(const DNSName &domain, const ComboAddress& remote)
 
 
     g_log<<Logger::Error<<"AXFR done for '"<<domain<<"', zone committed with serial number "<<zs.soa_serial<<endl;
+
+    bool renotify = false;
     if(::arg().mustDo("slave-renotify"))
+      renotify = true;
+    vector<string> meta;
+    if (B.getDomainMetadata(domain, "SLAVE-RENOTIFY", meta) && meta.size() > 0) {
+      if (meta[0] == "1") {
+        renotify = true;
+      } else {
+        renotify = false;
+      }
+    }
+    if(renotify)
       notifyDomain(domain);
   }
   catch(DBException &re) {