-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting upstream dns servers by resolv.conf #40
Comments
Knot-resolver iterates by default. Forwarding instead to other resolvers can be done via the policy module, e.g. with a ruleset like: modules.load('policy');
policy:add(policy.all(policy.FORWARD('8.8.8.8')))
policy:add(policy.all(policy.FORWARD('etc.'))) That is what Turris Omnia uses. |
Yes, I know that, but I have resolv.conf created by NetworkManager and would like to load it as is in kresd configuration. Maybe it could be scripted in lua? |
I see now. That seems the best approach. |
It there a documentation to that lua configuration language? I would need something like open resolv.conf file, iterate lines, if line starts with !nameserver " than run: |
It's just lua-5.1 (luajit implementation). The module only adds some values within |
It might be more difficult to reload the file whenever it changes, if you desire that. |
I know when it changes, I am using dispatcher script in NetworkManager. Is there a way to reload kresd configuration? In attached systemd configuration, there is only start and stop, no force-reload. |
You can certainly restart it. I don't think there's a better way currently. DNS records are in a persistent cache, so there isn't much to lose. |
You can either periodically check for changes in the config, see http://knot-resolver.readthedocs.io/en/latest/daemon.html#events-and-services (the doc mentions "File watchers" but that isn't implemented yet). Or change the live configuration, see http://knot-resolver.readthedocs.io/en/latest/daemon.html#scaling-out how you can change configuration of running instance with |
I am not sure how to connect with nc, what is |
|
You can force starting in non-interactive mode by passing |
I am starting kresd like this: |
The control socket on Debian is: |
Thanks a lot! Is this documented somewhere? |
This solution seems to be working for me so far:
I am reloading it with: It is not that clean, but fine so far. Could something like this be incorporated in kresd by default? Dnsmasq has |
Note: if a query matches multiple |
I've transformed this to Gitlab wiki https://gitlab.labs.nic.cz/knot/knot-resolver/wikis/-Configuring-upstream-DNS-forwarders-from-resolv.conf, closing. |
How to set upstream dns servers by resolv.conf file similar to dnsmasq option:
resolv-file=/etc/.../resolv.conf
This is needed to use kresd with NetworkManager.
The text was updated successfully, but these errors were encountered: