Unofficial Docker image for PowerDNS
156
This is an unofficial Docker image for PowerDNS. It creates a easily usable PowerDNS server with a MySQL backend.
The image is based on debian:11-slim.
latest: Latest version and latest build.<version>-build<build-date>: Specific version of PowerDNS, shipped from Debian, with build date. For example, 4.4.1.1-build20240101. See Tags tab for all available tags.You can pull this image from Docker Hub with command below:
docker pull josephcz/powerdns
Then, run the image with command below:
docker run -d --name powerdns \
-p 53:53/udp \
-p 53:53/tcp \
-p 127.0.0.1:8000:80 \
-v /etc/pdns.conf:/config/pdns.conf:ro \
josephcz/powerdns
This image does not use any environment variables.
This image uses volumes below:
| Host Path | Mount Point | Description |
|---|---|---|
Your powerdns configuration | /config/pdns.conf | PowerDNS configuration file |
The image listens on ports below:
53/udp: DNS Service53/tcp: DNS Service80/tcp: PowerDNS Web APIThe configuration file should be mounted to /config/pdns.conf. Here is an example PowerDNS configuration file:
webserver=yes
webserver-port=80
webserver-address=0.0.0.0
webserver-allow-from=127.0.0.1,10.0.0.0/24
api=yes
api-key=YOUR-SECRET-API-KEY
launch=gmysql
gmysql-host=host
gmysql-dbname=powerdns
gmysql-user=powerdns
gmysql-password=YOUR-DATABASE-PASSWORD
gmysql-dnssec=yes
default-soa-edit=INCEPTION-INCREMENT
default-soa-edit-signed=INCEPTION-INCREMENT
allow-axfr-ips=127.0.0.1,10.0.0.0/24
also-notify=10.0.0.54,10.0.0.55
only-notify=10.0.0.0/24
master=yes
This is a tipical Hidden Main Server authoritative server configuration. PowerDNS runs as main server, and two DNS server, 10.0.0.54 and 10.0.0.55 runs as authoritative servers that exposed to users. The configuration also exposes API on port 80.
Here is an example Docker Compose file:
version: '3.8'
networks:
powerdns:
name: powerdns
driver_opts:
com.docker.network.bridge.name: dockernet0
ipam:
config:
- subnet: 192.168.18.0/24
services:
powerdns:
image: josephcz/powerdns:latest
container_name: powerdns
restart: always
networks:
powerdns:
ipv4_address: 192.168.18.1
ports:
- 53:53/udp
- 53:53/tcp
- 127.0.0.1:8000:80
volumes:
- /srv/conf/pdns.conf:/config/pdns.conf:ro
healthcheck:
test: ["CMD", "curl", "-sfvo", "/dev/null", "localhost"]
retries: 3
timeout: 30s
interval: 30s
start_period: 15s
deploy:
resources:
limits:
memory: 768M
Build this image with command below:
docker build -t powerdns .
The PowerDNS is licensed under GNU General Public License v2.0. The Dockerfile follows the same license.
Content type
Image
Digest
sha256:c99489c82…
Size
68.1 MB
Last updated
over 2 years ago
docker pull josephcz/powerdns