我有pdns服务器4.2.3。我想通过api更改A记录的名称。示例:
test1 ttl 60 192.168.1.2->test2 A ttl 60 192.168.1.2
来自powerdns主机:
删除记录:
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 .
添加记录:
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 .
请相应调整TURBOSECRET、fqdn和zonename。