]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Enable the aggressive NSEC cache by default, if DNSSEC is enabled
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 24 Feb 2021 10:34:19 +0000 (11:34 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 24 Feb 2021 10:34:19 +0000 (11:34 +0100)
pdns/pdns_recursor.cc
pdns/recursordist/docs/settings.rst

index c0f713f4914d2a9e8e8798339824a5155830e86a..c4a34be77eeecdd42eae51f8180db19757950ebd 100644 (file)
@@ -4746,11 +4746,11 @@ static int serviceMain(int argc, char*argv[])
   s_addExtendedResolutionDNSErrors = ::arg().mustDo("extended-resolution-errors");
 
   if (::arg().asNum("aggressive-nsec-cache-size") > 0) {
-    if (g_dnssecmode == DNSSECMode::ValidateAll || g_dnssecmode == DNSSECMode::ValidateForLog) {
+    if (g_dnssecmode == DNSSECMode::ValidateAll || g_dnssecmode == DNSSECMode::ValidateForLog || g_dnssecmode == DNSSECMode::Process) {
       g_aggressiveNSECCache = make_unique<AggressiveNSECCache>(::arg().asNum("aggressive-nsec-cache-size"));
     }
     else {
-      g_log<<Logger::Warning<<"Aggressive NSEC/NSEC3 caching is enabled but DNSSEC validation is not set to 'validate' or 'log-fail', ignoring"<<endl;
+      g_log<<Logger::Warning<<"Aggressive NSEC/NSEC3 caching is enabled but DNSSEC validation is not set to 'validate', 'log-fail' or 'process', ignoring"<<endl;
     }
   }
 
@@ -5520,7 +5520,7 @@ int main(int argc, char **argv)
 
     ::arg().setSwitch("extended-resolution-errors", "If set, send an EDNS Extended Error extension on resolution failures, like DNSSEC validation errors")="no";
 
-    ::arg().setSwitch("aggressive-nsec-cache-size", "The number of records to cache in the aggressive cache. If set to a value greater than 0, and DNSSEC validation is enabled, the recursor will cache NSEC and NSEC3 records to generate negative answers, as defined in rfc8198")="0";
+    ::arg().setSwitch("aggressive-nsec-cache-size", "The number of records to cache in the aggressive cache. If set to a value greater than 0, and DNSSEC validation is enabled, the recursor will cache NSEC and NSEC3 records to generate negative answers, as defined in rfc8198")="100000";
 
     ::arg().setCmd("help","Provide a helpful message");
     ::arg().setCmd("version","Print version string");
index 63c65f68928163d28c30b6e84448987a4dec3899..ca2bf553452e95b980f526a60297a4ed2ac2931a 100644 (file)
@@ -28,7 +28,7 @@ variable to act as base setting. This is mostly useful for
 .. versionadded:: 4.5.0
 
 -  Integer
--  Default: 0
+-  Default: 100000
 
 The number of records to cache in the aggressive cache. If set to a value greater than 0, and DNSSEC validation is enabled, the recursor will cache NSEC and NSEC3 records to generate negative answers, as defined in :rfc:`8198`.
 This setting requires DNSSEC validation to be enabled via the `dnssec_` setting.