Also allow setting this at runtime.
: Reload authoritative and forward zones. Retains current configuration
in case of errors.
+set-dnssec-log-bogus *SETTING*
+: Set dnssec-log-bogus setting to *SETTING*. Set to 'on' or 'yes' to log DNSSEC
+ validation failures and to 'no' or 'off' to disable logging these failures.
+
set-minimum-ttl *NUM*
: Set minimum-ttl-override to *NUM*.
#### `validate`
Full blown DNSSEC validation. Send SERVFAIL to clients on bogus responses.
+## `dnssec-log-bogus`
+* Boolean
+* Default: no
+* Available since: 4.0.0
+
+Log every DNSSEC validation failure.
+**Note**: This is not logged per-query but every time records are validated as Bogus.
+
## `dont-query`
* Netmasks, comma separated
* Default: 127.0.0.0/8, 10.0.0.0/8, 100.64.0.0/10, 169.254.0.0/16, 192.168.0.0/16,
pw.getHeader()->ad=0;
}
else if(state == Bogus) {
- if(sr.doLog() || g_dnssecmode == DNSSECMode::ValidateForLog) {
+ if(g_dnssecLogBogus || sr.doLog() || g_dnssecmode == DNSSECMode::ValidateForLog) {
L<<Logger::Warning<<"Answer to "<<dc->d_mdp.d_qname<<" for "<<dc->d_remote.toStringWithPort()<<" validates as Bogus"<<endl;
}
exit(1);
}
+ g_dnssecLogBogus = ::arg().mustDo("dnssec-log-bogus");
+
if(::arg()["trace"]=="fail") {
SyncRes::setDefaultLogMode(SyncRes::Store);
}
::arg().setSwitch("non-local-bind", "Enable binding to non-local addresses by using FREEBIND / BINDANY socket options")="no";
::arg().set("trace","if we should output heaps of logging. set to 'fail' to only log failing domains")="off";
::arg().set("dnssec", "DNSSEC mode: off/process-no-validate (default)/process/log-fail/validate")="process-no-validate";
+ ::arg().set("dnssec-log-bogus", "Log DNSSEC bogus validations")="no";
::arg().set("daemon","Operate as a daemon")="no";
::arg().setSwitch("write-pid","Write a PID file")="yes";
::arg().set("loglevel","Amount of logging. Higher is more. Do not set below 3")="4";
#include "responsestats.hh"
#include "rec-lua-conf.hh"
+#include "validate-recursor.hh"
+
#include "secpoll-recursor.hh"
#include "pubsuffix.hh"
#include "namespaces.hh"
return ret;
}
+template<typename T>
+string doSetDnssecLogBogus(T begin, T end)
+{
+ if (begin == end)
+ return "No DNSSEC Bogus logging setting specified\n";
+
+ if (pdns_iequals(*begin, "on") || pdns_iequals(*begin, "yes")) {
+ if (!g_dnssecLogBogus) {
+ L<<Logger::Warning<<"Enabeling DNSSEC Bogus logging, requested via control channel"<<endl;
+ g_dnssecLogBogus = true;
+ return "DNSSEC Bogus logging enabled\n";
+ }
+ return "DNSSEC Bogus logging was already enabled\n";
+ }
+
+ if (pdns_iequals(*begin, "off") || pdns_iequals(*begin, "no")) {
+ if (g_dnssecLogBogus) {
+ L<<Logger::Warning<<"Disabeling DNSSEC Bogus logging, requested via control channel"<<endl;
+ g_dnssecLogBogus = false;
+ return "DNSSEC Bogus logging disabled\n";
+ }
+ return "DNSSEC Bogus logging was already disabled\n";
+ }
+
+ return "Unknown DNSSEC Bogus setting: '" + *begin +"'\n";
+}
+
template<typename T>
string doAddNTA(T begin, T end)
{
"reload-zones reload all auth and forward zones\n"
"set-minimum-ttl value set minimum-ttl-override\n"
"set-carbon-server set a carbon server for telemetry\n"
+"set-dnssec-log-bogus SETTING enable (SETTING=yes) or disable (SETTING=no) logging of DNSSEC validation failures\n"
"trace-regex [regex] emit resolution trace for matching queries (empty regex to clear trace)\n"
"top-largeanswer-remotes show top remotes receiving large answers\n"
"top-queries show top queries\n"
if(cmd=="get-tas") {
return getTAs();
}
-
+
+ if (cmd=="set-dnssec-log-bogus")
+ return doSetDnssecLogBogus(begin, end);
+
return "Unknown command '"+cmd+"', try 'help'\n";
}
#include "logger.hh"
DNSSECMode g_dnssecmode{DNSSECMode::ProcessNoValidate};
+bool g_dnssecLogBogus;
#define LOG(x) if(g_dnssecLOG) { L <<Logger::Warning << x; }
enum class DNSSECMode { Off, Process, ProcessNoValidate, ValidateForLog, ValidateAll };
extern DNSSECMode g_dnssecmode;
+extern bool g_dnssecLogBogus;