@@ -339,7 +339,7 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const std::string& zone)
339
339
DNSResourceRecord rr;
340
340
uint64_t numrecords=0 , numerrors=0 , numwarnings=0 ;
341
341
342
- set<string> cnames, noncnames;
342
+ set<string> records, cnames, noncnames;
343
343
344
344
while (sd.db ->get (rr)) {
345
345
if (!endsOn (rr.qname , zone)) {
@@ -351,6 +351,18 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const std::string& zone)
351
351
if (!rr.qtype .getCode ())
352
352
continue ;
353
353
354
+ ostringstream content;
355
+ content<<rr.qname <<" " <<rr.qtype .getName ();
356
+ if (rr.qtype .getCode () == QType::MX || rr.qtype .getCode () == QType::SRV)
357
+ content<<" " <<rr.priority ;
358
+ content<<" " <<rr.content ;
359
+ if (records.count (content.str ())) {
360
+ cout<<" [Error] Duplicate record found '" <<content.str ()<<" ' This do not belong in the database." <<endl;
361
+ numerrors++;
362
+ continue ;
363
+ } else
364
+ records.insert (content.str ());
365
+
354
366
if (rr.qtype .getCode () == QType::CNAME) {
355
367
if (!cnames.count (rr.qname ))
356
368
cnames.insert (rr.qname );
@@ -364,6 +376,7 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const std::string& zone)
364
376
if (!dk.isPresigned (zone)) {
365
377
cout<<" [Error] RRSIG found at '" <<rr.qname <<" ' in non-presigned zone. These do not belong in the database." <<endl;
366
378
numerrors++;
379
+ continue ;
367
380
}
368
381
} else
369
382
noncnames.insert (rr.qname );
0 commit comments