From 92cef2d6f44c4d36c66c916ee7691fb9aee896ac Mon Sep 17 00:00:00 2001 From: Kees Monshouwer Date: Tue, 30 Dec 2014 12:30:11 +0100 Subject: [PATCH] pdns_control make it posible to notify all zones at once --- pdns/dynhandler.cc | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/pdns/dynhandler.cc b/pdns/dynhandler.cc index c0b92441d..a33008944 100644 --- a/pdns/dynhandler.cc +++ b/pdns/dynhandler.cc @@ -266,15 +266,35 @@ string DLNotifyHostHandler(const vector&parts, Utility::pid_t ppid) string DLNotifyHandler(const vector&parts, Utility::pid_t ppid) { extern CommunicatorClass Communicator; - ostringstream os; + UeberBackend B; if(parts.size()!=2) return "syntax: notify domain"; if(!::arg().mustDo("master")) return "PowerDNS not configured as master"; L< domains; + B.getAllDomains(&domains); + + int total = 0; + int notified = 0; + for (vector::const_iterator di=domains.begin(); di != domains.end(); di++) { + if (di->kind == 0) { // MASTER + total++; + if(Communicator.notifyDomain(di->zone)) + notified++; + } + } + + if (total != notified) + return itoa(notified)+" out of "+itoa(total)+" zones added to queue - see log"; + return "Added "+itoa(total)+" MASTER zones to queue"; + } else { + if(!Communicator.notifyDomain(parts[1])) + return "Failed to add to the queue - see log"; + return "Added to queue"; + } } string DLRediscoverHandler(const vector&parts, Utility::pid_t ppid) -- 2.40.0