From e85a76ad3f494f83dfa026b145e3fa302006a466 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Fri, 29 Jan 2016 21:11:32 +0100 Subject: [PATCH] add create-slave-zone --- pdns/pdnsutil.cc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index a3c1ec66d4..dba97071f5 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..]"<