From e9cac63933ae9ddbb13a64406cff77640ab901dc Mon Sep 17 00:00:00 2001 From: Lucas Christian Date: Mon, 5 Oct 2020 14:35:17 -0500 Subject: pdns_recursor: T2964: Expose query-local-address to dns config. 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. --- data/templates/dns-forwarding/recursor.conf.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'data/templates/dns-forwarding/recursor.conf.tmpl') diff --git a/data/templates/dns-forwarding/recursor.conf.tmpl b/data/templates/dns-forwarding/recursor.conf.tmpl index b0ae3cc61..8799718b0 100644 --- a/data/templates/dns-forwarding/recursor.conf.tmpl +++ b/data/templates/dns-forwarding/recursor.conf.tmpl @@ -10,8 +10,8 @@ threads=1 allow-from={{ allow_from | join(',') }} log-common-errors=yes non-local-bind=yes -query-local-address=0.0.0.0 -query-local-address6=:: +query-local-address={{ source_address_v4 | join(',') }} +query-local-address6={{ source_address_v6 | join(',') }} lua-config-file=recursor.conf.lua # cache-size -- cgit v1.2.3