I have pdns server 4.2.3. I want to change name of A record by api. Example:
test1 A ttl 60 192.168.1.2 -> test2 A ttl 60 192.168.1.2
I have pdns server 4.2.3. I want to change name of A record by api. Example:
test1 A ttl 60 192.168.1.2 -> test2 A ttl 60 192.168.1.2
From the powerdns host:
To delete record:
curl -X PATCH --data '{"rrsets": [{"changetype": "DELETE", "type": "A", "name": "test1.fqdn."}]}' -H 'X-API-Key: TURBOSECRET' http://127.0.0.1:8081/api/v1/servers/localhost/zones/zonename. -s | jq .
To add record:
curl -X PATCH --data '{"rrsets": [{"changetype": "REPLACE", "type": "A", "name": "test2.fqdn.", "ttl": "60", "records": [{"content": "test2.fqdn.", "disabled": false}]}]}' -H 'X-API-Key: TURBOSECRET' http://127.0.0.1:8081/api/v1/servers/localhost/zones/zonename. -s | jq .
Please adjust accordingly TURBOSECRET, fqdn and zonename.