]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - pdns/pdnsutil.cc
Merge pull request #10081 from pieterlexis/issue-7203-pdnsutil-load-zone
[thirdparty/pdns.git] / pdns / pdnsutil.cc
index 6fcd28aa91c990bf9e6b1073e001d41830ac38cd..5a61aebb4ad69a356480ce9ccec5927f939b1cef 100644 (file)
@@ -1306,6 +1306,17 @@ static int loadZone(const DNSName& zone, const string& fname) {
       else
         haveSOA = true;
     }
+    try {
+      DNSRecordContent::mastermake(rr.qtype, QClass::IN, rr.content);
+    }
+    catch (const PDNSException &pe) {
+      cerr<<"Bad record content in record for "<<rr.qname<<"|"<<rr.qtype.getName()<<": "<<pe.reason<<endl;
+      return EXIT_FAILURE;
+    }
+    catch (const std::exception &e) {
+      cerr<<"Bad record content in record for "<<rr.qname<<"|"<<rr.qtype.getName()<<": "<<e.what()<<endl;
+      return EXIT_FAILURE;
+    }
     db->feedRecord(rr, DNSName());
   }
   db->commitTransaction();