使用PowerDNS REST api插入A记录

问题描述:

我有一个Web界面的问题。我使用mysql的powerdns v3.4.5作为后端。 我遵循的指示从这里: https://www.unixmen.com/how-to-install-powerdns-on-ubuntu-14-04/使用PowerDNS REST api插入A记录

我已经成功地安装powerdns与MySQL,并得到了web-API的工作。 但是我无法使用REST API插入A记录。从这里 我按照命令: https://doc.powerdns.com/md/httpapi/README/

这将创建一个新的区域:

curl -X POST --data '{"name":"example.org.", "kind": "Native", "masters": [], "nameservers": ["ns1.example.org.", "ns2.example.org."]}' -v -H 'X-API-Key: changeme' http://127.0.0.1:8081/servers/localhost/zones | jq . 

(请注意,我改变了URL和删除/ API/V1 /)

然而,当我运行以下命令来添加一个新的记录:

curl -X PATCH --data '{"rrsets": [ {"name": "test.example.org.", "type": "A", "ttl": 86400, "changetype": "REPLACE", "records": [ {"content": "192.0.5.4", "disabled": false } ] } ] }' -H 'X-API-Key: changeme' http://127.0.0.1:8081/servers/localhost/zones/example.org. | jq . 

我得到以下错误:

“错误”:“RRset test.example.org。 IN A:产品名称是出区的”

有什么,我缺少

它应该是如下:?

curl -X POST --data '{"name":"example.org", "kind": "Master","dnssec":false,"soa-edit":"INCEPTION-INCREMENT","masters": [], "nameservers": ["ns1.example.org"]}' -v -H 'X-API-Key: changeme' http://127.0.0.1:8081/servers/localhost/zones | jq . 

然后:

curl -X PATCH --data '{"rrsets": [ {"name": "test.example.org", "type": "A", "changetype": "REPLACE", "records": [ {"content": "192.168.9.9", "disabled": false, "name": "test.example.org", "ttl": 86400, "type": "A", "priority": 0 } ] } ] }' -H 'X-API-Key: changeme' http://127.0.0.1:8081/servers/localhost/zones/example.org | jq .