[Pdns-users] How to add master zone through PowerDNS API?

Melvin Mughal melvin at mughal.nu
Fri Feb 27 10:09:55 UTC 2015


That's a shame. It would be great if you could give the template name with
the API call and it would automatically create records from that template.
That would be a feature request ;)

2015-02-26 21:06 GMT+01:00 Christian Hofstaedtler <
christian.hofstaedtler at deduktiva.com>:

>
> > 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
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20150227/90b238b1/attachment-0001.html>


More information about the Pdns-users mailing list