Permalink
Browse files

pdnssec check-zone, fix record counting and improve out of zone check

  • Loading branch information...
1 parent 07ee700 commit 0dde9d060b0ddeef811b30113f54bf10e328dddd @mind04 mind04 committed with mind04 Sep 29, 2013
Showing with 7 additions and 6 deletions.
  1. +7 −6 pdns/pdnssec.cc
View
@@ -351,11 +351,7 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const std::string& zone)
if(!rr.qtype.getCode())
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;
- }
+ numrecords++;
if(rr.qtype.getCode() == QType::SOA) {
vector<string>parts;
@@ -393,6 +389,12 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const std::string& zone)
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<<rr.qname<<" "<<rr.qtype.getName()<<" "<<rr.content;
if (records.count(toLower(content.str()))) {
@@ -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;
numerrors++;
}
- numrecords++;
}
for(set<string>::const_iterator i = cnames.begin(); i != cnames.end(); i++) {

0 comments on commit 0dde9d0

Please sign in to comment.