int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, const vector<DNSResourceRecord>* suppliedrecords=0)
{
+ uint64_t numerrors=0, numwarnings=0;
+
+ DomainInfo di;
+ try {
+ if (!B.getDomainInfo(zone, di)) {
+ cout<<"[Error] Unable to get domain information for zone '"<<zone<<"'"<<endl;
+ return 1;
+ }
+ } catch(const PDNSException &e) {
+ if (di.kind == DomainInfo::Slave) {
+ cout<<"[Error] non-IP address for masters: "<<e.reason<<endl;
+ numerrors++;
+ }
+ }
+
SOAData sd;
if(!B.getSOAUncached(zone, sd)) {
cout<<"[Error] No SOA record present, or active, in zone '"<<zone<<"'"<<endl;
- cout<<"Checked 0 records of '"<<zone<<"', 1 errors, 0 warnings."<<endl;
+ numerrors++;
+ cout<<"Checked 0 records of '"<<zone<<"', "<<numerrors<<" errors, 0 warnings."<<endl;
return 1;
}
vector<string> checkKeyErrors;
bool validKeys=dk.checkKeys(zone, &checkKeyErrors);
- uint64_t numerrors=0, numwarnings=0;
-
if (haveNSEC3) {
if(isSecure && zone.wirelength() > 222) {
numerrors++;
sort(keys.begin(),keys.end());
reverse(keys.begin(),keys.end());
- bool shown=false;
for(const auto& key : keys) {
string algname = DNSSECKeeper::algorithm2name(key.d_algorithm);
cout << "DNSKEY = " <<zone.toString()<<" IN DNSKEY "<< key.getZoneRepresentation() << "; ( " + algname + " ) " <<endl;
}
- if (shown) continue;
- shown=true;
-
const std::string prefix(exportDS ? "" : "DS = ");
cout<<prefix<<zone.toString()<<" IN DS "<<makeDSFromDNSKey(zone, key, DNSSECKeeper::SHA1).getZoneRepresentation() << " ; ( SHA1 digest )" << endl;
cout<<prefix<<zone.toString()<<" IN DS "<<makeDSFromDNSKey(zone, key, DNSSECKeeper::SHA256).getZoneRepresentation() << " ; ( SHA256 digest )" << endl;