Denis Machard

My technical gists

Infrastructure architect by profession but always consider himself as a developer and an open source enthusiast.
@github @mastodon @rss

Build PowerDNS server with docker

clone the source code from powerdns repositories

git clone https://github.com/PowerDNS/pdns.git
git clone https://github.com/PowerDNS/pdns-builder.git
cp -rf pdns-builder /pdns/builder

build with docker

cd pdns/
sudo docker build . --file Dockerfile-auth --no-cache -t dmachard/pdns-auth-dev

prepare pdns config

mkdir pdns-dev
touch pdns.conf

add the following content to your config file

enable-lua-records=yes
dnsupdate=yes
loglevel=9

webserver=yes
webserver-address=0.0.0.0
webserver-allow-from=0.0.0.0/0
webserver-password=hello
webserver-port=8081

run the new pdns

sudo docker run -d -p 5354:53/udp -p 5354:53/tcp --name=powerdns-dev --volume=$PWD/pdns.conf:/etc/powerdns/pdns.d/pdns.conf:ro dmachard/pdns-auth-dev

add some dns data in your dns

sudo docker exec powerdns pdnsutil create-zone zone.test ns1.zone.test
sudo docker exec powerdns pdnsutil add-record zone.test ns1 A 3600 128.0.0.1
sudo docker exec powerdns pdnsutil add-record zone.test a A 300 128.0.0.2 

test your server

dig @127.0.0.1 -p 5354 a.zone.test
propulsed by hugo and hugo-theme-gists