From: Kees Monshouwer Date: Sat, 30 May 2015 23:11:12 +0000 (+0200) Subject: pdnssec: check for glue and delegations in parent zones X-Git-Tag: auth-3.4.5~1^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=561373e085a909940b9e946e3b68266e5f930a87;p=pdns pdnssec: check for glue and delegations in parent zones --- diff --git a/pdns/pdnssec.cc b/pdns/pdnssec.cc index cff8ca5ca..4aca052f3 100644 --- a/pdns/pdnssec.cc +++ b/pdns/pdnssec.cc @@ -414,17 +414,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.getSOA(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 '"<