Restart a PowerDNS instance. Only available when running in guardian mode.
## `notify DOMAIN`
-Adds a domain to the notification list, causing PowerDNS to send out notifications to the nameservers of a domain. Can be used if a slave missed previous notifications or is generally hard of hearing.
+Adds a domain to the notification list, causing PowerDNS to send out notifications to the nameservers of a domain. Can be used if a slave missed previous notifications or is generally hard of hearing. Use * to send notifications for all (type=MASTER) zones to all slaves.
## `notify-host DOMAIN HOST`
Same as above but with operator specified IP address as destination, to be used if you know better than PowerDNS.
string DLNotifyHandler(const vector<string>&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<<Logger::Warning<<"Notification request for domain '"<<parts[1]<<"' received from operator"<<endl;
- if(!Communicator.notifyDomain(parts[1]))
- return "Failed to add to the queue - see log";
- return "Added to queue";
+
+ if (parts[1] == "*") {
+ vector<DomainInfo> domains;
+ B.getAllDomains(&domains);
+
+ int total = 0;
+ int notified = 0;
+ for (vector<DomainInfo>::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<string>&parts, Utility::pid_t ppid)