PowerDNS Container built on PostgreSQL
1.2K
This container is based on gvangool/powerdns-authoritive and is used to create a PowerDNS container which can be linked to a PostgreSQL container such as the container provided by paintedfox/postgresql.
Create a local directory to store the PowerDNS database:
mkdir -p /opt/postgresql/pdns
Create a PostgreSQL container:
docker run -d --name="postgresql" -p 0.0.0.0:5432:5432 -v /opt/postgresql/pdns:/data -e USER="pdns" -e DB="powerdns" -e PASS="$(pwgen -1 16)" paintedfox/postgresql
Create the PowerDNS container, linking in the PostgreSQL container as pgsql:
docker run -d --name "powerdns" -p 0.0.0.0:53:53 -p 0.0.0.0:8053:8053 --link postgresql:pgsql zfjagann/powerdns
Insert some records:
powerdns=# insert into domains(name, type) values ('example.com', 'NATIVE');
INSERT 0 1
powerdns=# insert into records(domain_id, name, type, content, ttl) values (1, 'zealjagannatha.com', 'SOA', 'ns1.example.com admin.example.com 201405311007 86400 600 604800 300', 600);
INSERT 0 1
Rejoice:
# dig @<my-new-nameserver> SOA example.com
;; QUESTION SECTION:
;example.com. IN SOA
;; ANSWER SECTION:
example.com. 600 IN SOA ns1.example.com. admin.example.com. 3836815391 86400 600 604800 300
The dockerfile used to generate this container is attached below:
# This was largely copied from gvangool/powerdns-authoritive
FROM ubuntu:12.04
MAINTAINER Zeal Jagannatha <zealjagannatha.com>
# Set the env variable DEBIAN_FRONTEND to noninteractive
ENV DEBIAN_FRONTEND noninteractive
# Fix locales
RUN locale-gen en_US.UTF-8 && dpkg-reconfigure locales
# Enable universe
RUN echo "deb http://archive.ubuntu.com/ubuntu precise universe" >> /etc/apt/sources.list
RUN apt-get update && apt-get upgrade -y && apt-get clean && rm -rf /var/lib/apt/lists/*
# Install PowerDNS
RUN echo "START=no" > /etc/default/pdns && apt-get update && apt-get install pdns-server pdns-backend-pgsql -y && apt-get clean && rm -rf /var/lib/apt/lists/*
CMD /usr/sbin/pdns_server --no-config --master --daemon=no --local-address=0.0.0.0 --allow-axfr-ips=0.0.0.0/0 --launch=gpgsql --gpgsql-host=$PGSQL_PORT_5432_TCP_ADDR --gpgsql-port=$PGSQL_PORT_5432_TCP_PORT --gpgsql-user=${PGSQL_ENV_USER:-powerdns} --gpgsql-password=${PGSQL_ENV_PASS:-powerdns} --gpgsql-dbname=${PGSQL_ENV_DB:-powerdns} --webserver --webserver-address=0.0.0.0 --webserver-port=8053 --webserver-password=$WEBPASSWD
EXPOSE 53 8053
Content type
Image
Digest
sha256:06cbf5112…
Size
82.8 MB
Last updated
almost 11 years ago
docker pull zfjagann/powerdns