From: HÃ¥kan Lindqvist Date: Sat, 28 May 2016 17:17:57 +0000 (+0200) Subject: Validate names with address records to be valid hostnames in pdnsutil check-zone X-Git-Tag: rec-4.1.0-alpha1~301^2~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=277bec352e9917c9dc437b50fb0fc9defd431ae3;p=thirdparty%2Fpdns.git Validate names with address records to be valid hostnames in pdnsutil check-zone --- diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index 1283930d54..0136acede5 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -564,6 +564,17 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, const vect } } + if(rr.qtype.getCode() == QType::A || rr.qtype.getCode() == QType::AAAA) + { + Regex hostnameRegex=Regex("^(([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?)\\.)+$"); + if (!hostnameRegex.match(rr.qname.toString())) + { + cout<<"[Error] A or AAAA record found at '"<