::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("replication-cycle-interval","Schedule primary/secondary replication freshness checks once every .. seconds")="60";
::arg().set("tcp-control-address","If set, PowerDNS can be controlled over TCP on this address")="";
::arg().set("tcp-control-port","If set, PowerDNS can be controlled over TCP on this address")="53000";
::arg().set("tcp-control-secret","If set, PowerDNS can be controlled over TCP after passing this secret")="";
::arg().set("tcp-control-range","If set, remote control of PowerDNS is possible over these networks only")="127.0.0.0/8, 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, ::1/128, fe80::/10";
- ::arg().setSwitch("slave","Act as a slave")="no";
- ::arg().setSwitch("master","Act as a master")="no";
- ::arg().setSwitch("superslave", "Act as a superslave")="no";
+ ::arg().setSwitch("slave","Act as a secondary")="no";
+ ::arg().setSwitch("secondary","Act as a secondary")="no";
+ ::arg().setSwitch("master","Act as a primary")="no";
+ ::arg().setSwitch("primary","Act as a primary")="no";
+ ::arg().setSwitch("superslave", "Act as a autosecondary (formerly superslave)")="no";
+ ::arg().setSwitch("autosecondary", "Act as an autosecondary")="no";
::arg().setSwitch("disable-axfr-rectify","Disable the rectify step during an outgoing AXFR. Only required for regression testing.")="no";
::arg().setSwitch("guardian","Run within a guardian process")="no";
::arg().setSwitch("prevent-self-notification","Don't send notifications to what we think is ourself")="yes";
::arg().set("domain-metadata-cache-ttl","Seconds to cache domain metadata from the database")="60";
::arg().set("trusted-notification-proxy", "IP address of incoming notification proxy")="";
- ::arg().set("slave-renotify", "If we should send out notifications for slaved updates")="no";
+ ::arg().set("slave-renotify", "If we should send out notifications for secondaried updates")="no";
+ ::arg().set("secondary-renotify", "If we should send out notifications for secondaried updates")="no";
::arg().set("forward-notify", "IP addresses to forward received notifications to regardless of master or slave settings")="";
::arg().set("default-ttl","Seconds a result is valid if not set otherwise")="3600";
}
#endif
triggerLoadOfLibraries();
- if(::arg().mustDo("master") || ::arg().mustDo("slave"))
+ if(::arg().mustDo("master") || ::arg().mustDo("slave") || ::arg().mustDo("primary") || ::arg().mustDo("secondary"))
gethostbyname("a.root-servers.net"); // this forces all lookup libraries to be loaded
Utility::dropGroupPrivs(newuid, newgid);
if(chroot(::arg()["chroot"].c_str())<0 || chdir("/")<0) {
if(::arg().mustDo("webserver") || ::arg().mustDo("api"))
webserver.go();
- if(::arg().mustDo("slave") || ::arg().mustDo("master") || !::arg()["forward-notify"].empty())
+ if(::arg().mustDo("slave") || ::arg().mustDo("master") || ::arg().mustDo("primary") || ::arg().mustDo("secondary")|| !::arg()["forward-notify"].empty())
Communicator.go();
TN->go(); // tcp nameserver launch
try {
setThreadName("pdns/comm-main");
signal(SIGPIPE,SIG_IGN);
- g_log<<Logger::Error<<"Master/slave communicator launching"<<endl;
+ g_log<<Logger::Error<<"Primary/secondary communicator launching"<<endl;
PacketHandler P;
- d_tickinterval=::arg().asNum("slave-cycle-interval");
+ d_tickinterval=min(::arg().asNum("slave-cycle-interval"), ::arg().asNum("replication-cycle-interval"));
makeNotifySockets();
int rc;
ostringstream os;
if(parts.size()!=3)
return "syntax: notify-host domain ip";
- if(!::arg().mustDo("master") && !(::arg().mustDo("slave") && ::arg().mustDo("slave-renotify")))
- return "PowerDNS not configured as master or slave with re-notifications";
+ if(!(::arg().mustDo("master") || ::arg().mustDo("primary")) && !((::arg().mustDo("slave") || ::arg().mustDo("secondary")) && ::arg().mustDo("slave-renotify")))
+ return "PowerDNS not configured as primary (master), or secondary (slave) with re-notifications";
DNSName domain;
try {
UeberBackend B;
if(parts.size()!=2)
return "syntax: notify domain";
- if(!::arg().mustDo("master") && !(::arg().mustDo("slave") && ::arg().mustDo("slave-renotify")))
- return "PowerDNS not configured as master or slave with re-notifications";
+ if(!(::arg().mustDo("master") || ::arg().mustDo("primary")) && !((::arg().mustDo("slave") || ::arg().mustDo("secondary")) && ::arg().mustDo("slave-renotify")))
+ return "PowerDNS not configured as primary (master), or secondary (slave) with re-notifications";
g_log<<Logger::Warning<<"Notification request for domain '"<<parts[1]<<"' received from operator"<<endl;
if (parts[1] == "*") {
ostringstream ret;
int kindFilter = -1;
if (parts.size() > 1) {
- if (toUpper(parts[1]) == "MASTER")
+ if (toUpper(parts[1]) == "MASTER" || toUpper(parts[1]) == "PRIMARY")
kindFilter = 0;
- else if (toUpper(parts[1]) == "SLAVE")
+ else if (toUpper(parts[1]) == "SLAVE" || toUpper(parts[1]) == "SECONDARY")
kindFilter = 1;
else if (toUpper(parts[1]) == "NATIVE")
kindFilter = 2;
void CommunicatorClass::masterUpdateCheck(PacketHandler *P)
{
- if(!::arg().mustDo("master"))
+ if(!::arg().mustDo("master") && !::arg().mustDo("primary"))
return;
UeberBackend *B=P->getBackend();
g_log<<Logger::Debug<<"Received NOTIFY for "<<p.qdomain<<" from "<<p.getRemote()<<endl;
- if(!::arg().mustDo("slave") && s_forwardNotify.empty()) {
+ if(!::arg().mustDo("slave") && !::arg().mustDo("secondary") && s_forwardNotify.empty()) {
g_log<<Logger::Warning<<"Received NOTIFY for "<<p.qdomain<<" from "<<p.getRemote()<<" but slave support is disabled in the configuration"<<endl;
return RCode::Refused;
}
//
DomainInfo di;
if(!B.getDomainInfo(p.qdomain, di, false) || !di.backend) {
- if(::arg().mustDo("superslave")) {
+ if(::arg().mustDo("superslave") || ::arg().mustDo("autosecondary")) {
g_log<<Logger::Warning<<"Received NOTIFY for "<<p.qdomain<<" from "<<p.getRemote()<<" for which we are not authoritative, trying supermaster"<<endl;
return trySuperMaster(p, p.getTSIGKeyname());
}
}
g_log<<Logger::Notice<<"Received NOTIFY for "<<p.qdomain<<" from trusted-notification-proxy "<<p.getRemote()<<endl;
}
- else if(::arg().mustDo("master") && di.kind == DomainInfo::Master) {
+ else if((::arg().mustDo("master") || ::arg().mustDo("primary")) && di.kind == DomainInfo::Master) {
g_log<<Logger::Warning<<"Received NOTIFY for "<<p.qdomain<<" from "<<p.getRemote()<<" but we are master (Refused)"<<endl;
return RCode::Refused;
}
}
}
- if(::arg().mustDo("slave")) {
+ if(::arg().mustDo("slave") || ::arg().mustDo("secondary")) {
g_log<<Logger::Notice<<"Received NOTIFY for "<<p.qdomain<<" from "<<p.getRemote()<<" - queueing check"<<endl;
Communicator.addSlaveCheckRequest(di, p.d_remote);
}
} else if (cmds[0]=="activate-tsig-key") {
string metaKey;
if (cmds.size() < 4) {
- cerr << "Syntax: " << cmds[0] << " ZONE NAME {master|slave}" << endl;
+ cerr << "Syntax: " << cmds[0] << " ZONE NAME {primary|secondary|master|slave}" << endl;
return 0;
}
DNSName zname(cmds[1]);
string name = cmds[2];
- if (cmds[3] == "master")
+ if (cmds[3] == "master" || cmds[3] == "primary")
metaKey = "TSIG-ALLOW-AXFR";
- else if (cmds[3] == "slave")
+ else if (cmds[3] == "slave" || cmds[3] == "secondary")
metaKey = "AXFR-MASTER-TSIG";
else {
cerr << "Invalid parameter '" << cmds[3] << "', expected master or slave" << endl;
}
DNSName zname(cmds[1]);
string name = cmds[2];
- if (cmds[3] == "master")
+ if (cmds[3] == "master" || cmds[3] == "primary")
metaKey = "TSIG-ALLOW-AXFR";
- else if (cmds[3] == "slave")
+ else if (cmds[3] == "slave" || cmds[3] == "secondary")
metaKey = "AXFR-MASTER-TSIG";
else {
cerr << "Invalid parameter '" << cmds[3] << "', expected master or slave" << endl;
void CommunicatorClass::slaveRefresh(PacketHandler *P)
{
// not unless we are slave
- if (!::arg().mustDo("slave")) return;
+ if (!::arg().mustDo("slave") && !::arg().mustDo("secondary")) return;
UeberBackend *B=P->getBackend();
vector<DomainInfo> rdomains;
$RUNWRAPPER $PDNS2 --daemon=no --local-port=$port --config-dir=. \
--config-name=gsqlite32 --socket-dir=./ --no-shuffle \
- --slave --retrieval-threads=4 \
- --slave-cycle-interval=300 --dname-processing &
+ --secondary --retrieval-threads=4 \
+ --replication-cycle-interval=300 --dname-processing &
echo 'waiting for zones to be slaved'
set +e