From: Ruben Kerkhof Date: Sun, 14 Dec 2014 14:19:55 +0000 (+0100) Subject: Limit who can send us AXFR notify queries X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~124^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1953%2Fhead;p=thirdparty%2Fpdns.git Limit who can send us AXFR notify queries Fixes #1937 and #1120 --- diff --git a/docs/markdown/authoritative/settings.md b/docs/markdown/authoritative/settings.md index 9ede9c072a..923bf4eddd 100644 --- a/docs/markdown/authoritative/settings.md +++ b/docs/markdown/authoritative/settings.md @@ -22,6 +22,14 @@ If set, only these IP addresses or netmasks will be able to perform AXFR. Allow DNS updates from these IP ranges. +## `allow-notify-from` +* IP ranges, separated by commas +* Default: 0.0.0.0/0,::/0 +* Available since: 3.5.0 + +Allow AXFR NOTIFY from these IP ranges. +Setting this to an empty string will drop all incoming notifies. + ## `allow-recursion` * IP ranges, separated by commas diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index ac9256d8e6..edd9313caf 100644 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -101,6 +101,7 @@ void declareArguments() ::arg().set("allow-axfr-ips","Allow zonetransfers only to these subnets")="127.0.0.0/8,::1"; ::arg().set("only-notify", "Only send AXFR NOTIFY to these IP addresses or netmasks")="0.0.0.0/0,::/0"; ::arg().set("also-notify", "When notifying a domain, also notify these nameservers")=""; + ::arg().set("allow-notify-from","Allow AXFR NOTIFY from these IP ranges. If empty, drop all incoming notifies.")="0.0.0.0/0,::/0"; ::arg().set("slave-cycle-interval","Schedule slave freshness checks once every .. seconds")="60"; ::arg().set("tcp-control-address","If set, PowerDNS can be controlled over TCP on this address")=""; diff --git a/pdns/communicator.cc b/pdns/communicator.cc index b2b29b6b9d..ea22b1bacd 100644 --- a/pdns/communicator.cc +++ b/pdns/communicator.cc @@ -56,6 +56,14 @@ void CommunicatorClass::retrievalLoopThread(void) void CommunicatorClass::go() { + try { + PacketHandler::s_allowNotifyFrom.toMasks(::arg()["allow-notify-from"] ); + } + catch(PDNSException &e) { + L<qdomain<<" from "<getRemote()<<" but slave support is disabled in the configuration"<d_remote )) { + L<qdomain<<" from "<getRemote()<<" but remote is not in allow-notify-from"<