From 7f6f4d4f8c9f6a408b46ee1368a0fd1c45fd1b10 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Mon, 2 May 2016 17:22:21 +0200 Subject: [PATCH] make ALIAS expansion in outgoing AXFR optional --- pdns/common_startup.cc | 2 ++ pdns/pdns.conf-dist | 5 +++++ pdns/tcpreceiver.cc | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index 1f06d0bf6..af683d9bf 100644 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -180,6 +180,8 @@ void declareArguments() ::arg().set("include-dir","Include *.conf files from this directory"); ::arg().set("security-poll-suffix","Domain name from which to query security update notifications")="secpoll.powerdns.com."; + + ::arg().setSwitch("outgoing-axfr-expand-alias", "Expand ALIAS records during outgoing AXFR")="no"; } static time_t s_start=time(0); diff --git a/pdns/pdns.conf-dist b/pdns/pdns.conf-dist index 6ae2c787e..397355465 100644 --- a/pdns/pdns.conf-dist +++ b/pdns/pdns.conf-dist @@ -359,6 +359,11 @@ # # out-of-zone-additional-processing=yes +################################# +# outgoing-axfr-expand-alias Expand ALIAS records during outgoing AXFR +# +# outgoing-axfr-expand-alias=no + ################################# # overload-queue-length Maximum queuelength moving to packetcache only # diff --git a/pdns/tcpreceiver.cc b/pdns/tcpreceiver.cc index fc771a36e..3417fd11d 100644 --- a/pdns/tcpreceiver.cc +++ b/pdns/tcpreceiver.cc @@ -737,7 +737,7 @@ int TCPNameserver::doAXFR(const DNSName &target, shared_ptr q, int ou while(sd.db->get(rr)) { if(rr.qname.isPartOf(target)) { - if (rr.qtype.getCode() == QType::ALIAS) { + if (rr.qtype.getCode() == QType::ALIAS && ::arg().mustDo("outgoing-axfr-expand-alias")) { FindNS fns; vector ips=fns.lookup(DNSName(rr.content), (DNSBackend *) NULL); for(const auto& ip: ips) { -- 2.50.0