From: bert hubert Date: Fri, 29 Jan 2016 20:11:32 +0000 (+0100) Subject: add create-slave-zone X-Git-Tag: dnsdist-1.0.0-alpha2~24^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e85a76ad3f494f83dfa026b145e3fa302006a466;p=pdns add create-slave-zone --- diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index a3c1ec66d..dba97071f 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -1157,6 +1157,25 @@ int createZone(const DNSName &zone, const DNSName& nsname) { return 1; } +int createSlaveZone(const vector& cmds) { + UeberBackend B; + DomainInfo di; + DNSName zone(cmds[1]); + if (B.getDomainInfo(zone, di)) { + cerr<<"Domain '"<setKind(zone, DomainInfo::Slave); + di.backend->setMaster(zone, cmds[2]); + return EXIT_SUCCESS; +} + // add-record ZONE name type [ttl] "content" ["content"] int addOrReplaceRecord(bool addOrReplace, const vector& cmds) { DNSResourceRecord rr; @@ -2127,6 +2146,13 @@ seedRandom(::arg()["entropy-source"]); } exit(createZone(DNSName(cmds[1]), cmds.size() > 2 ? DNSName(cmds[2]): DNSName())); } + else if(cmds[0] == "create-slave-zone") { + if(cmds.size() < 3 ) { + cerr<<"Syntax: pdnsutil create-slave-zone ZONE master-ip [master-ip..]"<