Skip to content
Snippets Groups Projects
Commit f03364f8 authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

scripts/tools: updated doc, timers

parent 961a70a0
Branches
Tags
No related merge requests found
...@@ -747,6 +747,40 @@ specified worker count and process rank. ...@@ -747,6 +747,40 @@ specified worker count and process rank.
print(worker.stats().concurrent) print(worker.stats().concurrent)
Using CLI tools
===============
* ``kresd-host.lua`` - a drop-in replacement for *host(1)* utility
Queries the DNS for information.
The hostname is looked up for IP4, IP6 and mail.
Example:
.. code-block:: bash
$ kresd-host.lua -f root.key -v nic.cz
nic.cz. has address 217.31.205.50 (secure)
nic.cz. has IPv6 address 2001:1488:0:3::2 (secure)
nic.cz. mail is handled by 10 mail.nic.cz. (secure)
nic.cz. mail is handled by 20 mx.nic.cz. (secure)
nic.cz. mail is handled by 30 bh.nic.cz. (secure)
* ``kresd-query.lua`` - run the daemon in zero-configuration mode, perform a query and execute given callback.
This is useful for executing one-shot queries and hooking into the processing of the result,
for example to check if a domain is managed by a certain registrar or if it's signed.
Example:
.. code-block:: bash
$ kresd-query.lua www.sub.nic.cz 'assert(kres.dname2str(req:resolved().zone_cut.name) == "nic.cz.")' && echo "yes"
yes
$ kresd-query.lua -C 'trust_anchors.config("root.keys")' nic.cz 'assert(req:resolved():hasflag(kres.query.DNSSEC_WANT))'
$ echo $?
0
.. _`JSON-encoded`: http://json.org/example .. _`JSON-encoded`: http://json.org/example
.. _`Learn Lua in 15 minutes`: http://tylerneylon.com/a/learn-lua/ .. _`Learn Lua in 15 minutes`: http://tylerneylon.com/a/learn-lua/
.. _`PowerDNS Recursor`: https://doc.powerdns.com/md/recursor/scripting/ .. _`PowerDNS Recursor`: https://doc.powerdns.com/md/recursor/scripting/
......
...@@ -418,11 +418,15 @@ ffi.metatype( kr_request_t, { ...@@ -418,11 +418,15 @@ ffi.metatype( kr_request_t, {
__index = { __index = {
current = function(req) current = function(req)
assert(req) assert(req)
if req.current_query == nil then return nil end
return req.current_query return req.current_query
end, end,
resolved = function(req) resolved = function(req)
assert(req) assert(req)
return C.kr_rplan_resolved(C.kr_resolve_plan(req)) qry = C.kr_rplan_resolved(C.kr_resolve_plan(req))
if qry == nil then return nil end
return qry
end, end,
push = function(req, qname, qtype, qclass, flags, parent) push = function(req, qname, qtype, qclass, flags, parent)
assert(req) assert(req)
......
...@@ -280,7 +280,7 @@ local trust_anchors = { ...@@ -280,7 +280,7 @@ local trust_anchors = {
trust_anchors.keyset = {} trust_anchors.keyset = {}
if trust_anchors.update(new_keys, true) then if trust_anchors.update(new_keys, true) then
if trust_anchors.refresh_ev ~= nil then event.cancel(trust_anchors.refresh_ev) end if trust_anchors.refresh_ev ~= nil then event.cancel(trust_anchors.refresh_ev) end
refresh_plan(trust_anchors, 5 * sec, active_refresh, true, false) refresh_plan(trust_anchors, 10 * sec, active_refresh, true, false)
end end
end, end,
-- Add DS/DNSKEY record(s) (unmanaged) -- Add DS/DNSKEY record(s) (unmanaged)
...@@ -299,4 +299,4 @@ local trust_anchors = { ...@@ -299,4 +299,4 @@ local trust_anchors = {
end, end,
} }
return trust_anchors return trust_anchors
\ No newline at end of file
...@@ -12,7 +12,6 @@ Usage: %s [-vdh46D] [-c class] [-t type] ...@@ -12,7 +12,6 @@ Usage: %s [-vdh46D] [-c class] [-t type]
[-f keyfile] hostname [-f keyfile] hostname
Queries the DNS for information. Queries the DNS for information.
The hostname is looked up for IP4, IP6 and mail. The hostname is looked up for IP4, IP6 and mail.
If an ip-address is given a reverse lookup is done.
Use the -v option to see DNSSEC security information. Use the -v option to see DNSSEC security information.
-t type what type to look for. -t type what type to look for.
-c class what class to look for, if not class IN. -c class what class to look for, if not class IN.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment