From 95ba91f72771d6e55cbe0dc7f5456fc2cad9b705 Mon Sep 17 00:00:00 2001 From: Kees Monshouwer Date: Sun, 31 May 2015 01:11:12 +0200 Subject: [PATCH] pdnssec: check for glue and delegations in parent zones --- pdns/pdnssec.cc | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/pdns/pdnssec.cc b/pdns/pdnssec.cc index 1919a01a42..84539cc83c 100644 --- a/pdns/pdnssec.cc +++ b/pdns/pdnssec.cc @@ -417,17 +417,38 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const std::string& zone) bool isSecure=dk.isSecuredZone(zone); bool presigned=dk.isPresigned(zone); - sd.db->list(zone, sd.domain_id, true); DNSResourceRecord rr; uint64_t numrecords=0, numerrors=0, numwarnings=0; + + // Check for delegation in parent zone + string parent(zone); + while(chopOff(parent)) { + SOAData sd_p; + if(B.getSOAUncached(parent, sd_p)) { + bool ns=false; + DNSResourceRecord rr; + B.lookup(QType(QType::ANY), zone, NULL, sd_p.domain_id); + while(B.get(rr)) + ns |= (rr.qtype == QType::NS); + if (!ns) { + cerr<<"[Error] No delegation for zone '"< records, cnames, noncnames; + set records, cnames, noncnames, glue, checkglue; map ttl; ostringstream content; pair::iterator,bool> ret; + sd.db->list(zone, sd.domain_id, true); + while(sd.db->get(rr)) { if(!rr.qtype.getCode()) continue; @@ -523,6 +544,10 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const std::string& zone) } else if (rr.qtype.getCode() == QType::DNSKEY) { cout<<"[Warning] DNSKEY record not at apex '"<