set-ecs-minimum-ttl *NUM*
Set ecs-minimum-ttl-override to *NUM*.
+set-max-aggr-nsec-cache-size *NUM*
+ Change the maximum number of entries in the NSEC aggressive cache. If the
+ cache is disabled by setting its size to 0 in the config, the cache size
+ cannot be set by this command. Setting the size to 0 by this command still
+ keeps the cache, but makes it mostly ineffective as it emptied periodically.
+
set-max-cache-entries *NUM*
Change the maximum number of entries in the DNS cache. If reduced, the
cache size will start shrinking to this number as part of the normal
}
}
+template <typename T>
+static RecursorControlChannel::Answer setAggrNSECCacheSize(T begin, T end)
+{
+ if (end - begin != 1) {
+ return {1, "Need to supply new aggressive NSEC cache size\n"};
+ }
+ if (!g_aggressiveNSECCache) {
+ return {1, "Aggressive NSEC cache is disabled by startup config\n"};
+ }
+ try {
+ auto newmax = pdns::checked_stoi<uint64_t>(*begin);
+ g_aggressiveNSECCache->setMaxEntries(newmax);
+ return {0, "New aggressive NSEC cache size: " + std::to_string(newmax) + "\n"};
+ }
+ catch (const std::exception& e) {
+ return {1, "Error parsing the new aggressive NSEC cache size: " + std::string(e.what()) + "\n"};
+ }
+}
+
static uint64_t getSysTimeMsec()
{
struct rusage ru;
"reload-lua-config [filename] (re)load Lua configuration file\n"
"reload-zones reload all auth and forward zones\n"
"set-ecs-minimum-ttl value set ecs-minimum-ttl-override\n"
- "set-max-cache-entries value set new maximum cache size\n"
+ "set-max-aggr-nsec-cache-size set new maximum aggressive NSEC cache size\n"
+ "set-max-cache-entries value set new maximum record cache size\n"
"set-max-packetcache-entries val set new maximum packet cache size\n"
"set-minimum-ttl value set minimum-ttl-override\n"
"set-carbon-server set a carbon server for telemetry\n"
if (cmd == "list-dnssec-algos") {
return {0, DNSCryptoKeyEngine::listSupportedAlgoNames()};
}
+ if (cmd == "set-aggr-nsec-cache-size") {
+ return setAggrNSECCacheSize(begin, end);
+ }
return {1, "Unknown command '" + cmd + "', try 'help'\n"};
}