-
Notifications
You must be signed in to change notification settings - Fork 326
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
pdns_recursor: T2964: Expose query-local-address to dns config. #563
Conversation
Hi @lucasec, thank you for the contribution. Any reason we can not use source-address include and thus name the node source-address as we have in many other places? |
Agree, it should be |
One more addition, the default values could be passed in by specifying the 0.0.0.0 :: node which now supports mumtiple values as whitespace separated list, which is clearer then habing this in the Python helper script - as this is actually part of the CLI definition and we are in the middle of cleaning this up ;). |
Agree on using @c-po I'm assuming you mean use the |
@lucasec I just remembered that We should not change the default value for all users of the include file - thus please keep your default assignment in the python helper for the time beeing and simply use the |
Another blocker on using the include, the Should we just pass on the include for now until more work can be done on the templating system? I will push up a commit that renames the property to |
@lucasec good catch - please proceed as you lined out! |
In certain split DNS configurations, there is a need for more fine-grained control over the local address DNS forwarding uses to issue queries. The current pdns_recursor configuration allows the recursor to send queries from any available address on the interface the OS selects for the query, with no option to limit queries to a particular address or set of addresses. This commit exposes the `query-local-address` option in `recursor.conf` to users via the `service` `dns` `forwarding` `source-address` config node. If the parameter is unspecified, the default value of 0.0.0.0 (any IPv4 address) and :: (any IPv6 address) are used to match current behavior. Users who want more control can specify one or more IPv4 and IPv6 addresses to issue queries from. Per pdns_recursor docs, the recursor will load balance queries between any available addresses in the pools. Since IPv4 and IPv6 are different pools, note that specifying only one type of address will disable issuing queries for the other address family.
2e6e236
to
e9cac63
Compare
As a bonus, now that we're not constrained by includes, I switched to |
PR should be updated and ready to merge. I tested to make sure the new |
Hhm, |
It works as @c-po mentioned in his comment above—for |
Actually precedent for that is hard to find, as it's only been used in one other place so far: e4e75aa#diff-3debbbaec7fa1e1d4119681239a53a1dR29 |
@lucasec I'd say this is more like an emergent behaviour... I wonder if we should allow multiple default value elements instead. I'm happy to approve the PR as it, but it may be something to consider codifying in the future. |
Task reference: T2964
Description
In certain split DNS configurations, there is a need for more fine-grained control over the local address DNS forwarding uses to issue queries. The current pdns_recursor configuration allows the recursor to send queries from any available address on the interface the OS selects for the query, with no option to limit queries to a particular address or set of addresses.
This commit exposes the
query-local-address
option inrecursor.conf
to users via theservice
dns
forwarding
query-source-address
config node.If the parameter is unspecified, the default value of 0.0.0.0 (any IPv4 address) and :: (any IPv6 address) are used to match current behavior.
Users who want more control can specify one or more IPv4 and IPv6 addresses to issue queries from. Per pdns_recursor docs, the recursor will load balance queries between any available addresses in the pools. Since IPv4 and IPv6 are different pools, note that specifying only one type of address will disable issuing queries for the other address family.
Changes
query-source-address
to dns forwarding config mode definitonTesting
You can test this PR by using the following example configuration (assuming the router has an IPv4 address of 10.5.1.1 that can be used to reach some resolver):
Additional Notes
I have not located an obvious way to set the source address per-downstream resolver (as is possible in dnsmasq, see the ticket). If anyone more familiar knowns of any pdns lua wizardry, I'm all ears.
The current pdns_recursor 4.3.4 distributed with VyOS requires the source addresses to be specified in two different parameters
query-local-address
(for IPv4 addresses) andquery-local-address6
(for IPv6 addresses). The configuration code accommodates this transparently for the user, allowing them to specify both address families in the samequery-source-address
node and appropriately splitting the addresses out into separate entries when rendering the config file.Release notes indicate starting with pdns_recursor 4.4.0 both address families can be specified in the same
query-local-address
parameter and thequery-local-address6
parameter will be deprecated and removed in 4.5.0. A comment was added so hopefully someone remembers this when we inevitably upgrade to a newer release.