Skip to content

Commit

Permalink
pdnsutil {add-record,delete-rrset}: Don't append ZONE if NAME ends wi…
Browse files Browse the repository at this point in the history
…th .

If a NAME ends with a . it is to be understood as an absolute name and
appending the zone is not intuitive then.

Note this changes behaviour for calls like:

	pdnsutil --config-dir=configs/auth add-record example.net . NS 1.2.3.4

which added the NS record to the zone's apex before and is likely an
error now.

Closes: PowerDNS#8595
  • Loading branch information
ukleinek committed Dec 18, 2024
1 parent 2a1e55f commit 907844e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pdns/pdnsutil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1599,6 +1599,8 @@ static int addOrReplaceRecord(bool addOrReplace, const vector<string>& cmds) {
DNSName name;
if (cmds.at(2) == "@")
name=zone;
else if (isCanonical(cmds.at(2)))
name = DNSName(cmds.at(2));
else
name = DNSName(cmds.at(2)) + zone;

Expand Down Expand Up @@ -1737,6 +1739,8 @@ static int deleteRRSet(const std::string& zone_, const std::string& name_, const
DNSName name;
if(name_=="@")
name=zone;
else if (isCanonical(name_))
name = DNSName(name_);
else
name=DNSName(name_)+zone;

Expand Down

0 comments on commit 907844e

Please sign in to comment.