From eed2ecbe3ffbe9172f25a07bcac29dd9332326cf Mon Sep 17 00:00:00 2001 From: bert hubert Date: Mon, 15 Feb 2016 21:06:12 +0100 Subject: [PATCH] add clear-zone which clears all records but keeps the zone around --- pdns/pdnsutil.cc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index 9e59fd4ec3..eadfad741e 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -865,6 +865,21 @@ int read1char(){ return c; } +int clearZone(DNSSECKeeper& dk, const DNSName &zone) { + UeberBackend B; + DomainInfo di; + + if (! B.getDomainInfo(zone, di)) { + cerr<<"Domain '"<startTransaction(zone, di.id)) { + cerr<<"Unable to start transaction for load of zone '"<commitTransaction(); + return 0; +} int editZone(DNSSECKeeper& dk, const DNSName &zone) { UeberBackend B; @@ -1831,6 +1846,7 @@ try cerr<<"check-zone ZONE Check a zone for correctness"< 2) { cerr<<"Syntax: pdnsutil list-keys [ZONE]"<