Score:0

PowerDNS API changetype REPLACE does not replace a RRset

ro flag

I'm making the following API call to PowerDNS, expecting to replace the old record value oldhostname.example.net with the new value newhostname.example.net.

PATCH /api/v1/servers/localhost/zones/example.org
X-API-Key: secret
Content-Type: application/json
{
  "rrsets": [
    {
      "name": "test.example.org.",
      "type": "CNAME",
      "ttl": 3600,
      "changetype": "REPLACE",
      "records": [
        {
          "content": "newhostname.example.net.",
          "disabled": false
        }
      ]
    }
  ]
}

The result is 400 error from the API with the messsage "The CNAME record you are trying to create already exists."

I know the record test.example.org already exists, my intent was to replace it with the new content.

Making two separate calls, one to delete and another to add, works. But I want to avoid any momentary NXDOMAIN responses to queries between the 2 API calls which could be negative cached on other DNS forwarders in the environment and cause a longer than necessary outage.

If "changetype": "REPLACE" does not actually replace the record, then what is the correct way to update a record in this API?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.