diff --git a/pdns/dnsrecords.cc b/pdns/dnsrecords.cc index e096be81ef7f..85ce9e471ef0 100644 --- a/pdns/dnsrecords.cc +++ b/pdns/dnsrecords.cc @@ -36,7 +36,10 @@ void DNSResourceRecord::setContent(const string &cont) { case QType::MX: if (content.size() >= 2 && *(content.rbegin()+1) == ' ') return; - /* Falls through. */ + [[fallthrough]]; +#if !defined(RECURSOR) + case QType::ALIAS: +#endif case QType::CNAME: case QType::DNAME: case QType::NS: @@ -64,6 +67,9 @@ string DNSResourceRecord::getZoneRepresentation(bool noDot) const { if (*(last.rbegin()) != '.' && !noDot) ret << "."; break; +#if !defined(RECURSOR) + case QType::ALIAS: +#endif case QType::CNAME: case QType::DNAME: case QType::NS: diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index 3a35755fd051..4ab130292ccf 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -1113,8 +1113,17 @@ static int listZone(const DNSName &zone) { while(di.backend->get(rr)) { if(rr.qtype.getCode() != 0) { - if ( (rr.qtype.getCode() == QType::NS || rr.qtype.getCode() == QType::SRV || rr.qtype.getCode() == QType::MX || rr.qtype.getCode() == QType::CNAME) && !rr.content.empty() && rr.content[rr.content.size()-1] != '.') - rr.content.append(1, '.'); + switch (rr.qtype.getCode()) { + case QType::ALIAS: + case QType::CNAME: + case QType::MX: + case QType::NS: + case QType::SRV: + if (!rr.content.empty() && rr.content[rr.content.size()-1] != '.') { + rr.content.append(1, '.'); + } + break; + } cout<