[Pdns-users] How to add master zone through PowerDNS API?
Christian Hofstaedtler
christian.hofstaedtler at deduktiva.com
Thu Feb 26 20:06:11 UTC 2015
> On 26 Feb 2015, at 21:06, Melvin Mughal <melvin at mughal.nu> wrote:
>
> I've seen the API example (http://doc.powerdns.com/md/httpapi/README/), but it doesn't show how to create a new zone with an existing zone template. How can I include the zone template in that API call?
There are no templates, but you can include records with the create call.
Example:
curl -X POST --data '{
"name": "example.com",
"kind": "Native",
"masters": [],
"nameservers": ["ns1.example.org", "ns2.example.org"],
"records": [
{
"name": "www.example.com",
"type": "A",
"ttl": 3600,
"content": “192.0.2.4",
"disabled": false
}
]
}' -v -H 'X-API-Key: changeme' http://127.0.0.1:8081/servers/localhost/zones
Christian
--
Christian Hofstaedtler / Deduktiva GmbH (FN 418592 b, HG Wien)
www.deduktiva.com / +43 1 353 1707
More information about the Pdns-users
mailing list