Skip to content

Commit

Permalink
pdnssec check-zone, fix record counting and improve out of zone check
Browse files Browse the repository at this point in the history
  • Loading branch information
mind04 committed Nov 22, 2013
1 parent 07ee700 commit 0dde9d0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pdns/pdnssec.cc
Expand Up @@ -351,11 +351,7 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const std::string& zone)
if(!rr.qtype.getCode()) if(!rr.qtype.getCode())
continue; continue;


if(!endsOn(rr.qname, zone)) { numrecords++;
cout<<"[Warning] Record '"<<rr.qname<<" IN "<<rr.qtype.getName()<<" "<<rr.content<<"' in zone '"<<zone<<"' is out-of-zone."<<endl;
numwarnings++;
continue;
}


if(rr.qtype.getCode() == QType::SOA) { if(rr.qtype.getCode() == QType::SOA) {
vector<string>parts; vector<string>parts;
Expand Down Expand Up @@ -393,6 +389,12 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const std::string& zone)
continue; continue;
} }


if(!endsOn(rr.qname, zone)) {
cout<<"[Warning] Record '"<<rr.qname<<" IN "<<rr.qtype.getName()<<" "<<rr.content<<"' in zone '"<<zone<<"' is out-of-zone."<<endl;
numwarnings++;
continue;
}

content.str(""); content.str("");
content<<rr.qname<<" "<<rr.qtype.getName()<<" "<<rr.content; content<<rr.qname<<" "<<rr.qtype.getName()<<" "<<rr.content;
if (records.count(toLower(content.str()))) { if (records.count(toLower(content.str()))) {
Expand Down Expand Up @@ -497,7 +499,6 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const std::string& zone)
cout<<"[Error] Following record is auth=0, run pdnssec rectify-zone?: "<<rr.qname<<" IN " <<rr.qtype.getName()<< " " << rr.content<<endl; cout<<"[Error] Following record is auth=0, run pdnssec rectify-zone?: "<<rr.qname<<" IN " <<rr.qtype.getName()<< " " << rr.content<<endl;
numerrors++; numerrors++;
} }
numrecords++;
} }


for(set<string>::const_iterator i = cnames.begin(); i != cnames.end(); i++) { for(set<string>::const_iterator i = cnames.begin(); i != cnames.end(); i++) {
Expand Down

0 comments on commit 0dde9d0

Please sign in to comment.