Dockerized PowerDNS
Usage with docker compose
services:
dns:
image: docker.asperti.com/paspo/powerdns:latest
container_name: dns
ports:
- 127.0.0.1:1053:53
- 127.0.0.1:1053:53/udp
- 127.0.0.1:8081:8081 # api endpoint
environment:
API_KEY=ciaociao # please use a serious key
DB_PATH=/db/pdns.sqlite
volumes:
- ./db:/db
list zones
curl -H "X-API-Key: ciaociao" http://127.0.0.1:8081/api/v1/servers/localhost/zones | jq
add a zone
curl -H "X-API-Key: ciaociao" -X POST -d \
'{"name":"ciao.com.", "kind":"native", "masters": [], "nameservers":[] }' \
http://127.0.0.1:8081/api/v1/servers/localhost/zones | jq
list zone content
curl -H "X-API-Key: ciaociao" http://127.0.0.1:8081/api/v1/servers/localhost/zones/ciao.com | jq
add a record
curl -H "X-API-Key: ciaociao" -X PATCH -d \
'{"rrsets": [{"name": "test.ciao.com.", "type": "A", "ttl": 3600, "changetype": "REPLACE", "records": [{"content": "192.168.254.5", "disabled": false}]}]}' \
http://127.0.0.1:8081/api/v1/servers/localhost/zones/ciao.com
RFC2136 dns updates
TODO
Languages
Shell
70.8%
Dockerfile
29.2%