From: Pieter Lexis Date: Tue, 17 Mar 2020 11:29:48 +0000 (+0100) Subject: Auth: deprecate query-local-address6 X-Git-Tag: dnsdist-1.5.0-rc3~53^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9cee91cbffd3bef33dd93a27deb4d67286587054;p=thirdparty%2Fpdns.git Auth: deprecate query-local-address6 This is merged with query-local-address --- diff --git a/docs/appendices/FAQ.rst b/docs/appendices/FAQ.rst index e464cd0c88..056ad3a069 100644 --- a/docs/appendices/FAQ.rst +++ b/docs/appendices/FAQ.rst @@ -59,7 +59,7 @@ Also, check that the configured backend is master or slave capable and you enter My masters won't allow PowerDNS to access zones as it is using the wrong local IP address ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ By default, PowerDNS lets the kernel pick the source address. -To set an explicit source address, use the :ref:`setting-query-local-address` and :ref:`setting-query-local-address6` settings. +To set an explicit source address, use the :ref:`setting-query-local-address` setting. PowerDNS does not answer queries on all my IP addresses (and I've ignored the warning I got about that at startup) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/settings.rst b/docs/settings.rst index 5fbdbcbabc..1ddc85ad44 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -1270,21 +1270,33 @@ Seconds to store queries with an answer in the Query Cache. See :ref:`query-cach ``query-local-address`` ----------------------- +.. versionchanged:: 4.4.0 + Accepts both IPv4 and IPv6 addresses. Also accept more than one address per + address family. -- IPv4 Address -- Default: 0.0.0.0 +- IP addresses, separated by spaces or commas +- Default: 0.0.0.0 :: -The IP address to use as a source address for sending queries. Useful if +The IP addresses to use as a source address for sending queries. Useful if you have multiple IPs and PowerDNS is not bound to the IP address your operating system uses by default for outgoing packets. +PowerDNS will pick the correct address family based on the remote's address (v4 +for outgoing v4, v6 for outgoing v6). However, addresses are selected at random +without taking into account ip subnet reachability. It is highly recommended to +use the defaults in that case (the kernel will pick the right source address for +the network). + .. _setting-query-local-address6: ``query-local-address6`` ------------------------ +.. deprecated:: 4.4.0 + Use :ref:`setting-query-local-address`. The default has been changed + from '::' to unset. - IPv6 Address -- Default: '::' +- Default: unset Source IP address for sending IPv6 queries. diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index 8ba1ce6dfc..837bcb53d2 100644 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -92,8 +92,8 @@ void declareArguments() ::arg().setSwitch("local-address-nonexist-fail","Fail to start if one or more of the local-address's do not exist on this server")="yes"; ::arg().setSwitch("non-local-bind", "Enable binding to non-local addresses by using FREEBIND / BINDANY socket options")="no"; ::arg().setSwitch("reuseport","Enable higher performance on compliant kernels by using SO_REUSEPORT allowing each receiver thread to open its own socket")="no"; - ::arg().set("query-local-address","Source IP address for sending queries")="0.0.0.0"; - ::arg().set("query-local-address6","Source IPv6 address for sending queries")="::"; + ::arg().set("query-local-address","Source IP address for sending queries")="0.0.0.0 ::"; + ::arg().set("query-local-address6","DEPRECATED: Use query-local-address. Source IPv6 address for sending queries")=""; ::arg().set("overload-queue-length","Maximum queuelength moving to packetcache only")="0"; ::arg().set("max-queue-length","Maximum queuelength before considering situation lost")="5000"; @@ -630,7 +630,10 @@ void mainthread() } pdns::parseQueryLocalAddress(::arg()["query-local-address"]); - pdns::parseQueryLocalAddress(::arg()["query-local-address6"]); + if (!::arg()["query-local-address6"].empty()) { + g_log<go(); diff --git a/pdns/mastercommunicator.cc b/pdns/mastercommunicator.cc index 7b45c76c89..84627b70b3 100644 --- a/pdns/mastercommunicator.cc +++ b/pdns/mastercommunicator.cc @@ -215,7 +215,7 @@ time_t CommunicatorClass::doNotifications(PacketHandler *P) ComboAddress remote(ip, 53); // default to 53 if((d_nsock6 < 0 && remote.sin4.sin_family == AF_INET6) || (d_nsock4 < 0 && remote.sin4.sin_family == AF_INET)) { - g_log<