From: Kees Monshouwer Date: Tue, 30 Dec 2014 11:30:11 +0000 (+0100) Subject: pdns_control make it posible to notify all zones at once X-Git-Tag: auth-3.4.2~14^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=92cef2d6f44c4d36c66c916ee7691fb9aee896ac;p=thirdparty%2Fpdns.git pdns_control make it posible to notify all zones at once --- diff --git a/pdns/dynhandler.cc b/pdns/dynhandler.cc index c0b92441d8..a33008944a 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)