Hi,
thanks, I was able to write a script, that takes data from
NetworkManager and configures running Knot Resolver. I have follow up
question though. Is is possible with current implementation of the
policy module to see configured rules?
~ $ sudo nc -U /run/knot-resolver/control@1
policy.rules
[1] => {
[count] => 339
[id] => 0
[cb] => function: 0x415a9f68
}
[2] => {
[count] => 0
[id] => 1
[cb] => function: 0x415b6700
}
[3] => {
[count] => 3
[id] => 2
[cb] => function: 0x41d6d8a0
}
[4] => {
[count] => 1622
[id] => 3
[cb] => function: 0x415c5170
}
Looking at the output and the code in "policy.lua" I think there is not,
but I am asking just to be sure :-). I think it would be nice to see
configured policy using the "kresc" utility.
Finally, in the Fedora spec file, the http module is removed due to
unsatisfied dependencies. Is it just lua-http what is missing? Because I
tried the docker image, and the REST api seems really nice and I'd like
to see it in Fedora.
Best regards,
Martin Sehnoutka
On 04/20/2018 12:52 PM, Petr Špaček wrote:
Hi,
you can talk to Unix socket, please see example here:
http://knot-resolver.readthedocs.io/en/latest/daemon.html#scaling-out
It accepts the same syntax as in configuration file, i.e.
http://knot-resolver.readthedocs.io/en/latest/modules.html#query-policies
applies here as well.
You might want to use `policy.del` to get rid of previous policy rule,
please see
http://knot-resolver.readthedocs.io/en/latest/modules.html#policy-examples
... and let us know if you need any help.
Petr Špaček @ CZ.NIC
On 20.4.2018 12:33, Martin Sehnoutka wrote:
Hi,
I would like to run Knot Resolver with DNS-over-TLS on my laptop, but I
need to configure 'policy.FORWARD' whenever I connect to our corporate
network. The information about new connection is provided by the Network
Manager, that is not a problem, but then I need to configure the
resolver somehow. I was thinking about creating a new configuration file
and simply restarting the server, but it fails with "Start request
repeated too quickly".
Is there a way to add/remove policy rules "on the fly"?
The HTTP/2 module seems like a good candidate for doing this. Can this
module be used to accomplish this task?
Best regards,
Martin Sehnoutka
PS: If there is anyone using dnssec-trigger, this would be similar, but
less complicated.
--
Martin Sehnoutka | Associate Software Engineer
PGP: 5FD64AF5
UTC+1 (CET)
RED HAT | TRIED. TESTED. TRUSTED.