Knot Resolver: Resolve DNS names like it's 2022! https://www.knot-resolver.cz/support/
> cache.get('cz')
[c.ns.nic.cz] => {
[A] => true
[AAAA] => true
}
[cz] => {
[NS] => true
[DNSKEY] => true
[DS] => true
}
[seznam.cz] => {
[NS] => true
}
[ans.seznam.cz] => {
[A] => true
[AAAA] => true
}
[www.seznam.cz] => {
[A] => true
}
[hc3bc4rs8r2ai3kioqv5c3ktorkc39h4.cz] => {
[NSEC3] => true
}
[ams.seznam.cz] => {
[A] => true
[AAAA] => true
}
[b.ns.nic.cz] => {
[A] => true
[AAAA] => true
}
[a.ns.nic.cz] => {
[A] => true
[AAAA] => true
}
[d.ns.nic.cz] => {
[A] => true
[AAAA] => true
}
return kr_error(ENOMEM);
}@oerdnj I have tried adding 'http' to modules={} but it complains that http module cannot be found: error: module 'http' not found: error: No such file or directory.
Is it a .lua module? Do we have to recompile the daemon with different flags?
The relevant config part looks like:
modules = {
'policy', -- Block queries to local zones/bad sites
'view', -- Handle requests by source IP
'stats', -- Track internal statistics
'http',
}
@oerdnj It's a custom rpm package. Now I see, there is a part of the rpm which excludes this module. I'll check it out.
What about the socket Vladimir talked about? Isn't it an easier way if it's already built in? Can I configure where the socket appears? How do I find which socket is meant to be used for this communication?
local s, f = '', io.open('logs', 'a') for k,v in pairs(stats.list()) do s = s .. string.format('%s = %d\n', k, v) end f:write(s) f:close()
(untested, but you get the idea) it will append stats to a logs
file. You can schedule to do this every minute for example, like event.recurrent(1 * minute, function () local s, f = '', io.open('logs', 'a') for k,v in pairs(stats.list()) do s = s .. string.format('%s = %d\n', k, v) end f:write(s) f:close() end)
(you just put this in the config). See http://knot-resolver.readthedocs.io/en/stable/daemon.html#events-and-services
view
module does it https://github.com/CZ-NIC/knot-resolver/blob/master/modules/view/view.lua#L66-L69