From: Miod Vallat Date: Fri, 21 Feb 2025 09:51:31 +0000 (+0100) Subject: Suggest invoking increase-serial in pdnsutil create-zone X-Git-Tag: dnsdist-2.0.0-alpha2~119^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=357e79c91cfd59635b3c9ed653b693590d6c46d0;p=thirdparty%2Fpdns.git Suggest invoking increase-serial in pdnsutil create-zone (unless default-soa-content specifies a nonzero serial number or default-soa-edit is empty or NONE) --- diff --git a/docs/settings.rst b/docs/settings.rst index 283ea3e2a1..95e4ab99e3 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -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 `. .. _setting-default-soa-edit-signed: diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index ccca24bb6a..2de41cfad5 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -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; }