[Pdns-users] How to create new zone on the API?
corey at bitaccel.com
corey at bitaccel.com
Fri Mar 15 16:25:10 UTC 2019
I've followed the documentation and created a call to the API but it doesn't
seem to create a new zone, it only creates NS and SOA records. Here is the
snippet I tried -
POST <http://104.255.99.99:8081/api/v1/servers/localhost/zones>
http://104.255.99.99:8081/api/v1/servers/localhost/zones
{"name":"2.255.255.255.in-addr.arpa.", "kind":
"Native","dnssec":false,"masters": [], "serial": "2014060500",
"nameservers": ["rdns1.bitaccel.com.", "rdns2.bitaccel.com."]}
I also tried
POST
<http://104.255.99.99:8081/api/v1/servers/localhost/zones>
http://104.255.99.99:8081/api/v1/servers/localhost/zones
{
"comments": [
{ "account": "JP", "content": "My first API-created zone", "name": "uhuh",
"type": "dunno" }
],
"kind": "Native",
"masters": [],
"name": "example.net.",
"nameservers": [
"ns1.example.net.",
"ns2.example.net."
],
"records": [
{ "content": "ns.example.net. hostmaster.example.com. 1 1800 900 604800
86400", "disabled": false, "name": "example.net.", "ttl": 86400, "type":
"SOA" }
,
{ "content": "192.168.1.42", "disabled": false, "name": "www.example.net.",
"ttl": 3600, "type": "A" }
]
}
But it didn't create the A records according to pdns web interface or dig it
just created some SOA and NS records. (See dig below)
dig www.example.net '@rdns1.bitaccel.com'
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.68.rc1.el6_10.1 <<>> www.example.net
@rdns1.bitaccel.com
;; global options: +cmd
;; Got answer:
;; opcode: QUERY, status: NXDOMAIN, id: 23148
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;www.example.net. IN A
;; AUTHORITY SECTION:
example.net. 3600 IN SOA a.misconfigured.powerdns.server.
hostmaster.example.net. 2019031501 10800 3600 604800 3600
;; Query time: 1 msec
;; SERVER: 104.255.99.99#53(104.255.99.99)
;; WHEN: Fri Mar 15 01:17:28 2019
;; MSG SIZE rcvd: 111
[root at rdns1 rdns-scripts]# dig example.net '@rdns1.bitaccel.com'
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.68.rc1.el6_10.1 <<>> example.net
@rdns1.bitaccel.com
;; global options: +cmd
;; Got answer:
;; opcode: QUERY, status: NOERROR, id: 32109
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;example.net. IN A
;; AUTHORITY SECTION:
example.net. 3600 IN SOA a.misconfigured.powerdns.server.
hostmaster.example.net. 2019031501 10800 3600 604800 3600
;; Query time: 1 msec
;; SERVER: 104.255.99.99#53(104.255.99.99)
;; WHEN: Fri Mar 15 01:17:37 2019
;; MSG SIZE rcvd: 107
Anyone have any ideas what I could be doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20190315/a4bbb855/attachment.html>
More information about the Pdns-users
mailing list