Public Repository

Last pushed: 2 years ago
Short Description
PowerDNS server with MySQL
Full Description

This container requires MySQL.

 docker run -p 53:53 -p 53:53/udp -e "MYSQL_ROOT_PASSWORD=mysqlsecret" \
     --name pdns-container \
     -e "PDNS_MYSQL_DB_NAME=pdns" \
     -e "PDNS_MYSQL_DB_USER=pdns" \
     -e "PDNS_MYSQL_DB_PASSWORD=password" \
     -e "RECURSOR_ADDRESS=8.8.8.8" \
     --link mysql-container:mysql yuanying/pdns-mysql

And insert your domain data.

Connect MySQL server

docker run -it --link some-mysql:mysql --rm mysql sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"'

And insert your data

INSERT INTO domains (name, type)
VALUES ('localdomain', 'NATIVE');

INSERT INTO records (domain_id, name, content, type, ttl, prio)
VALUES (1, 'localdomain', 'ns.localdomain postmaster@localdomain 1',
'SOA', 60, NULL);

INSERT INTO records (domain_id, name, content, type, ttl, prio)
VALUES (1, 'localdomain', 'ns.localdomain', 'NS', 60, NULL);

INSERT INTO records (domain_id, name, content, type, ttl, prio)
VALUES (1, 'localdomain', 'mail.localdomain', 'MX', 60, 0);

INSERT INTO records (domain_id, name, content, type, ttl, prio)
VALUES (1, 'ns.localdomain', '192.168.3.58', 'A', 60, NULL);

INSERT INTO records (domain_id, name, content, type, ttl, prio)
VALUES (1, 'mail.localdomain', '192.168.3.59', 'A', 60, NULL);

INSERT INTO records (domain_id, name, content, type, ttl, prio)
VALUES (1, 'www.localdomain', '192.168.3.58', 'A', 60, NULL);

Dockerfile

Docker Pull Command
Owner
yuanying