]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Let pdnsutil advise refreshing the zone cache upon zone creation.
authorMiod Vallat <miod.vallat@powerdns.com>
Mon, 22 Dec 2025 13:14:46 +0000 (14:14 +0100)
committerMiod Vallat <miod.vallat@powerdns.com>
Tue, 23 Dec 2025 20:44:13 +0000 (21:44 +0100)
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
pdns/pdnsutil.cc
regression-tests.nobackend/gsqlite3-corrupted-record/expected_result
regression-tests.nobackend/lmdb-id-generation/expected_result
regression-tests.nobackend/lmdb-metadata-leak/expected_result
regression-tests/tests/zone-variants/expected_result.lmdb

index e654857ce0e622f9070ae4c1e7a3b382732a92b4..a60652113690a831247f9469c6fdfac6e40087c7 100644 (file)
@@ -686,6 +686,7 @@ static void loadMainConfig(const std::string& configdir)
   ::arg().set("cache-ttl","Seconds to store packets in the PacketCache")="20";
   ::arg().set("negquery-cache-ttl","Seconds to store negative query results in the QueryCache")="60";
   ::arg().set("query-cache-ttl","Seconds to store query results in the QueryCache")="20";
+  ::arg().set("zone-cache-refresh-interval", "Seconds to cache list of known zones") = "300";
   ::arg().set("default-soa-content","Default SOA content")="a.misconfigured.dns.server.invalid hostmaster.@ 0 10800 3600 604800 3600";
   ::arg().set("chroot","Switch to this chroot jail")="";
   ::arg().set("dnssec-key-cache-ttl","Seconds to cache DNSSEC keys from the database")="30";
@@ -2653,6 +2654,10 @@ static int createZone(const ZoneName &zone, const DNSName& nsname) {
     }
   }
 
+  if (::arg().asNum("zone-cache-refresh-interval") != 0) {
+    cout << "If the authoritative server is running, be sure to refresh its zone cache" << endl << "with 'pdns_control rediscover'" << endl;
+  }
+
   return EXIT_SUCCESS;
 }
 
index 343b6d22dbcce82129f8480408002924fb0ecac1..23ad966072c119562e7c15bf506f20622f87f8b9 100644 (file)
@@ -1,3 +1,5 @@
+If the authoritative server is running, be sure to refresh its zone cache
+with 'pdns_control rediscover'
 New rrset:
 bug.less. 3600 IN NS no.bug.less.
 New rrset:
index 127b73f5966d6c76e64a219e20f61f0540966e9a..d5848e1ab1dfe26e3e10535a9f8132223c778ac0 100644 (file)
@@ -1,2 +1,6 @@
+If the authoritative server is running, be sure to refresh its zone cache
+with 'pdns_control rediscover'
 sequential generator generated 1 2 3 correctly
+If the authoritative server is running, be sure to refresh its zone cache
+with 'pdns_control rediscover'
 random generator generated something other than 1 2 3, good
index 8e5e29d5c68814aa62d57d0fa88e255c48375f77..b9a8736e075b750a851a2669c116002b1505d0dd 100644 (file)
@@ -1,5 +1,7 @@
 === random=no
 == creating zone
+If the authoritative server is running, be sure to refresh its zone cache
+with 'pdns_control rediscover'
 WARNING: local files have been created as a result of this operation.
 Be sure to check the files owner, group and permission to make sure that
 the authoritative server can correctly use them.
@@ -19,6 +21,8 @@ FOO2
 == deleting zone
 === random=yes
 == creating zone
+If the authoritative server is running, be sure to refresh its zone cache
+with 'pdns_control rediscover'
 WARNING: local files have been created as a result of this operation.
 Be sure to check the files owner, group and permission to make sure that
 the authoritative server can correctly use them.
index 9fbb87d32ca0073de003c1da77a8e58a8590ba3e..a4fd54aade495170e8b499057b1af171cf0d6a19 100644 (file)
@@ -1,4 +1,6 @@
 Creating empty zone 'example.com..variant1'
+If the authoritative server is running, be sure to refresh its zone cache
+with 'pdns_control rediscover'
 This is a Native zone
 Variant: variant1
 Zone is not actively secured
@@ -6,6 +8,8 @@ Metadata items:
        SOA-EDIT-API    DEFAULT
 No keys for zone 'example.com..variant1'.
 Creating empty zone '..myroot'
+If the authoritative server is running, be sure to refresh its zone cache
+with 'pdns_control rediscover'
 This is a Native zone
 Variant: myroot
 Zone is not actively secured
@@ -13,6 +17,8 @@ Metadata items:
        SOA-EDIT-API    DEFAULT
 No keys for zone '..myroot'.
 Creating empty zone '.'
+If the authoritative server is running, be sure to refresh its zone cache
+with 'pdns_control rediscover'
 This is a Native zone
 Zone is not actively secured
 Metadata items: