Unable to add new zone/domain in PowerDNS using API

752 Views Asked by At

I was trying to add new zone using following:

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

I was expecting, I'll add new zone but I got following error:

"error": "DNS Name 'saugat.local' is not canonical"

Error Details

1

There are 1 best solutions below

2
On

You need to add a trailing dot to make the domain in canonical shape

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