Hello,
at the moment there is no built-in module with this statistics but it
can be hacked around (see below).
BTW we plan to to rework stats so it would be very valuable to get your
requirements!
To make sure future version contains what you need, can you specify what
kind of data + what configuration you want to get? For example:
- How many 'most frequent' IP addresses you want to get?
- Should the number of addresses be configurable?
- Do you consider query from the same IP but different port as
'different client' or not? (E.g. clients behind NAT?)
- Should IP addresses be somehow tied to most frequent query names or not?
- Do you need a way to flush the table on fly?
For now you can use the following Lua config snippet to log client IP
addresses.
-- start of config snippet
function LOG_IP(state, req)
req = kres.request_t(req)
if req.qsource == nil or req.qsource.addr == nil then
-- internal request, no source
return state end
print('query from IP ' .. tostring(req.qsource.addr))
return -- continue with other policy rules
end
policy.add(policy.all(LOG_IP))
-- end of config snipper
Output looks like this:
"query from IP ::1#56927"
This can be further processed by your log processing system to get
aggregate numbers over all resolvers or alternativelly it can be
extended using LRU library in Lua to get stats for single resolver.
I hope it helps.
Petr Špaček @ CZ.NIC
On 24.7.2018 09:32, Sýkora Milan wrote:
Hello,
I have your cool DNS resolver in version 2.3.0, I know that was released
newest version.
My question is – is it possible to explore the most frequented IP
(queries source) in the module stats? Or exist any other way how to
achieve it?
Many thanks for your answer in the future,
Best regards.
*Milan Sýkora***