[go: up one dir, main page]

0% found this document useful (0 votes)
31 views2 pages

PowerDNS Httpapi

The document provides an introduction to the HTTP API for PowerDNS, detailing configuration options such as enabling the experimental JSON interface and web server. It includes example commands for listing zones, creating a new zone, and adding records using curl with an API key. The document also mentions the use of jq for formatting JSON responses.

Uploaded by

digicport
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views2 pages

PowerDNS Httpapi

The document provides an introduction to the HTTP API for PowerDNS, detailing configuration options such as enabling the experimental JSON interface and web server. It includes example commands for listing zones, creating a new zone, and adding records using curl with an API key. The document also mentions the use of jq for formatting JSON responses.

Uploaded by

digicport
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

HTTP API - Introduction - PowerDNS http://doc.powerdns.

com/md/httpapi/README/

experimental-json-interface=yes
experimental-api-key=changeme
webserver=yes

pdns_server

1 -> 2 07.01.2015 10:30


HTTP API - Introduction - PowerDNS http://doc.powerdns.com/md/httpapi/README/

# List zones
curl -H 'X-API-Key: changeme' http://127.0.0.1:8081/servers/localhost/zones | jq .

# Create new zone "example.org" with nameservers ns1.example.org, ns2.example.org


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

# Show the new zone


curl -H 'X-API-Key: changeme' http://127.0.0.1:8081/servers/localhost/zones/example.or
g | jq .

# Add a new record to the new zone (would replace any existing test.example.org/A reco
rds)
curl -X PATCH --data '{"rrsets": [ {"name": "test.example.org", "type": "A", "changety
pe": "REPLACE", "records": [ {"content": "1.1.1.1", "disabled": false, "name": "test.e
xample.org", "ttl": 86400, "type": "A", "priority": 0 } ] } ] }' -H 'X-API-Key: change
me' http://127.0.0.1:8081/servers/localhost/zones/example.org | jq .

jq jq json_pp
python -mjson.tool

experimental-webserver=yes
experimental-api-key=changeme
auth-zones=
forward-zones=
forward-zones-recurse=

pdns_recursor

curl -v -H 'X-API-Key: changeme' http://127.0.0.1:8082/servers/localhost | jq .


curl -v -H 'X-API-Key: changeme' http://127.0.0.1:8082/servers/localhost/zones | jq .

api_specs.md

#powerdns irc.oftc.net

2 -> 2 07.01.2015 10:30

You might also like