]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Suggest invoking increase-serial in pdnsutil create-zone 15197/head
authorMiod Vallat <miod.vallat@powerdns.com>
Fri, 21 Feb 2025 09:51:31 +0000 (10:51 +0100)
committerMiod Vallat <miod.vallat@powerdns.com>
Mon, 17 Mar 2025 11:04:03 +0000 (12:04 +0100)
(unless default-soa-content specifies a nonzero serial number or
default-soa-edit is empty or NONE)

docs/settings.rst
pdns/pdnsutil.cc

index 283ea3e2a1cab0dcd7fa791e7e3e386407b86a3e..95e4ab99e3e31a9ee5a8e17191662f52a859f9ea 100644 (file)
@@ -469,6 +469,7 @@ This value is used when a zone is created without providing a SOA record. @ is r
 
 Use this soa-edit value for all zones if no
 :ref:`metadata-soa-edit` metadata value is set.
+This is used by :doc:`pdnsutil increase-serial <manpages/pdnsutil.1>`.
 
 .. _setting-default-soa-edit-signed:
 
index ccca24bb6ab74390368ae9adc6392f3690a4b6ab..2de41cfad57a3c09522f69caf6b00202afefdf50 100644 (file)
@@ -1588,6 +1588,15 @@ static int createZone(const DNSName &zone, const DNSName& nsname) {
 
   di.backend->commitTransaction();
 
+  // Zone is not secured yet, suggest applying default-soa-edit rule to the
+  // serial number, if applicable.
+  if (sd.serial == 0) {
+    string edit_kind = ::arg()["default-soa-edit"];
+    if (!edit_kind.empty() && !pdns_iequals(edit_kind, "NONE")) {
+      cout << "Consider invoking 'pdnsutil increase-serial " << zone << "'" << endl;
+    }
+  }
+
   return EXIT_SUCCESS;
 }