dnsdist: Add config nob to add logging of "Drops" (queries)
- Program: dnsdist
- Issue type: Feature request
Short description
Add config nob for logging of "Drops" (reported in dnsdist stats)
Usecase
Per old thread https://mailman.powerdns.com/pipermail/pdns-users/2015-December/023910.html Drops can currently only be logged / looked at using verbose logging. But running dnsdist in verbose mode in production would produce too much information (mainly working queries) and unnecessary amount of logs.
Description
"Keep the log amount as low as possible, and just log (all) errors"
What I've seen during verbose output, most reported Drops are queries against non funct domains
dnsdist[3531804]: Had a downstream timeout from [::1]:8053 (workeripv6) for query for 111.199.123.112.in-addr.arpa|PTR from 10.100.0.1:27149
dnsdist[3531804]: Had a downstream timeout from [::1]:8053 (workeripv6) for query for contact.id|A from 10.100.0.1::39975
Add a knob for logging the queries that times out? (as the messages above)
I was going to suggest addTimeoutResponseAction and LogResponseAction but it tries to access the (presumably empty) header. Maybe that is an easy fix though.
but otherwise you can do this with Lua in 2.0.0 and forward:
local function foo(dq)
infolog(dq.qname:toString())
return DNSResponseAction.None
end
addTimeoutResponseAction(AllRule(),LuaResponseAction(foo))
Aha, thanks for the pointer! I'll give it a try
I was going to suggest
addTimeoutResponseActionandLogResponseActionbut it tries to access the (presumably empty) header. Maybe that is an easy fix though.but otherwise you can do this with Lua in 2.0.0 and forward:
local function foo(dq) infolog(dq.qname:toString()) return DNSResponseAction.None end
addTimeoutResponseAction(AllRule(),LuaResponseAction(foo))
dnsdist-2.0.0~alpha1 doesn't seem to like this configuration stanza unfortunately
# dnsdist --check-config
Fatal Lua error: [string "chunk"]:107: attempt to call global 'addTimeoutResponseAction' (a nil value)
stack traceback:
[string "chunk"]:107: in main chunk
might have been slightly after the alpha was out :)
Closing this since 2.0.0 has been released.