From 0429faf134029aefe7d738c068756930ef71ff54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Tue, 17 Dec 2024 23:15:56 +0100 Subject: [PATCH] pdnsutil {add-record,delete-rrset}: Don't append ZONE if NAME ends with . If a NAME ends with a . it is to be understood as an absolute name and appending the zone is not intuitive then. Closes: https://github.com/PowerDNS/pdns/issues/8595 --- pdns/pdnsutil.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index ed19662297cdf..60e59379f6a75 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -1599,6 +1599,8 @@ static int addOrReplaceRecord(bool addOrReplace, const vector& cmds) { DNSName name; if (cmds.at(2) == "@") name=zone; + else if (boost::ends_with(cmds.at(2), ".")) + name = DNSName(cmds.at(2)); else name = DNSName(cmds.at(2)) + zone; @@ -1737,6 +1739,8 @@ static int deleteRRSet(const std::string& zone_, const std::string& name_, const DNSName name; if(name_=="@") name=zone; + else if (boost::ends_with(name_, ".")) + name = DNSName(name_); else name=DNSName(name_)+zone;