From 120b4dc6c9a6b89dc01604bd871a78719d6cf5bc Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Sat, 26 Dec 2015 19:33:21 +0200 Subject: [PATCH] Show DNSSEC keys for slaved zone --- pdns/pdnsutil.cc | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index fe3cec6e33..1a688ee2a0 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -1129,9 +1129,50 @@ bool showZone(DNSSECKeeper& dk, const DNSName& zone) cerr << "Zone uses following TSIG key(s): " << boost::join(meta, ",") << endl; } - cout <<"Zone is " << (dk.isPresigned(zone) ? "" : "not ") << "presigned"< keys; + DNSResourceRecord rr; - if(keyset.empty()) { + B.lookup(QType(QType::DNSKEY), DNSName(zone)); + while(B.get(rr)) { + if (rr.qtype != QType::DNSKEY) continue; + keys.push_back(*dynamic_cast(DNSKEYRecordContent::make(rr.getZoneRepresentation()))); + } + + if(keys.empty()) { + cerr << "No keys for zone '"<