numwarnings++;
}
}
-
- if(!suppliedrecords && rr.auth == 0 && rr.qtype.getCode()!=QType::NS && rr.qtype.getCode()!=QType::A && rr.qtype.getCode()!=QType::AAAA)
- {
- cout<<"[Error] Following record is auth=0, run pdnsutil rectify-zone?: "<<rr.qname<<" IN " <<rr.qtype.getName()<< " " << rr.content<<endl;
- numerrors++;
- }
}
for(auto &i: cnames) {
for( const auto &qname : checkOcclusion ) {
for( const auto &rr : records ) {
if( qname.first == rr.qname && ((( rr.qtype == QType::NS || rr.qtype == QType::DS ) && qname.second == QType::NS ) || ( rr.qtype == QType::DNAME && qname.second == QType::DNAME ) ) ) {
- continue;
+ continue;
}
if( rr.qname.isPartOf( qname.first ) ) {
if( qname.second == QType::DNAME || ( rr.qtype != QType::ENT && rr.qtype.getCode() != QType::A && rr.qtype.getCode() != QType::AAAA ) ) {
}
}
+ bool ok, ds_ns, done;
+ for( const auto &rr : records ) {
+ ok = ( rr.auth == 1 );
+ ds_ns = false;
+ done = (suppliedrecords || !sd.db->doesDNSSEC());
+ for( const auto &qname : checkOcclusion ) {
+ if( qname.second == QType::NS ) {
+ if( qname.first == rr.qname ) {
+ ds_ns = true;
+ }
+ if ( done ) {
+ continue;
+ }
+ if( rr.auth == 0 ) {
+ if( rr.qname.isPartOf( qname.first ) && ( qname.first != rr.qname || rr.qtype != QType::DS ) ) {
+ ok = done = true;
+ }
+ if( rr.qtype == QType::ENT && qname.first.isPartOf( rr.qname ) ) {
+ ok = done = true;
+ }
+ } else if( rr.qname.isPartOf( qname.first ) && ( ( qname.first != rr.qname || rr.qtype != QType::DS ) || rr.qtype == QType::NS ) ) {
+ ok = false;
+ done = true;
+ }
+ }
+ }
+ if( ! ds_ns && rr.qtype.getCode() == QType::DS && rr.qname != zone ) {
+ cout << "[Warning] DS record without a delegation '" << rr.qname<<"'." << endl;
+ numwarnings++;
+ }
+ if( ! ok && ! suppliedrecords ) {
+ cout << "[Error] Following record is auth=" << rr.auth << ", run pdnsutil rectify-zone?: " << rr.qname << " IN " << rr.qtype.getName() << " " << rr.content << endl;
+ numerrors++;
+ }
+ }
+
cout<<"Checked "<<records.size()<<" records of '"<<zone<<"', "<<numerrors<<" errors, "<<numwarnings<<" warnings."<<endl;
if(!numerrors)
return EXIT_SUCCESS;