Giter Club home page Giter Club logo

docker-pdns's Introduction

PowerDNS Docker Images

This repository contains the following Docker images - pdns-mysql, pdns-pgsql, pdns-recursor and pdns-admin. Image pdns-mysql contains completely configurable PowerDNS 4.x server with mysql backend (without mysql server). Image pdns-pgsql contains completely configurable PowerDNS 4.x server with postgres backend (without postgres server). Image pdns-recursor contains completely configurable PowerDNS 5.x recursor. Image pdns-admin contains fronted (Caddy) and backend (uWSGI) for the PowerDNS Admin web app, which is written in Flask and used for managing PowerDNS servers.

The pdns-mysql, pdns-pgsql and pdns-recursor images have also the alpine tag, thanks to @PoppyPop.

All images are available on Docker Hub:

https://hub.docker.com/r/pschiffe/pdns-mysql/

https://hub.docker.com/r/pschiffe/pdns-pgsql/

https://hub.docker.com/r/pschiffe/pdns-recursor/

https://hub.docker.com/r/pschiffe/pdns-admin/

Source GitHub repository: https://github.com/pschiffe/docker-pdns


Static Badge Static Badge

If this project is useful to you, please consider sponsoring me to support maintenance and further development. Thank you!

pdns-mysql

Docker Image Size (tag) Docker Image Size (tag) Docker Pulls

https://hub.docker.com/r/pschiffe/pdns-mysql/

Docker image with PowerDNS 4.x server and mysql backend. Requires external mysql server. Env vars for mysql configuration:

(name=default value)

PDNS_gmysql_host=mysql
PDNS_gmysql_port=3306
PDNS_gmysql_user=root
PDNS_gmysql_password=powerdns
PDNS_gmysql_dbname=powerdns

If linked with the official mariadb image using the alias mysql, the connection can be automatically configured, eliminating the need to specify any of the above. The DB is automatically initialized if tables are missing.

The PowerDNS server is configurable via env vars. Every variable starting with PDNS_ will be inserted into /etc/pdns/pdns.conf conf file in the following way: prefix PDNS_ will be stripped away and every _ will be replaced with -. For example, from the above mysql config, PDNS_gmysql_host=mysql will became gmysql-host=mysql in /etc/pdns/pdns.conf file. This way, you can configure PowerDNS server in any way you need within a docker run command.

The SUPERMASTER_IPS env var is also supported, which can be used to configure supermasters for a slave DNS server. Docs. Multiple IP addresses separated by spaces should work.

You can find all the available settings here.

Examples

Example of a master server with the API enabled and one slave server configured:

docker run -d -p 53:53 -p 53:53/udp --name pdns-master \
  --hostname ns1.example.com --link mariadb:mysql \
  -e PDNS_primary=yes \
  -e PDNS_api=yes \
  -e PDNS_api_key=secret \
  -e PDNS_webserver=yes \
  -e PDNS_webserver_address=0.0.0.0 \
  -e PDNS_webserver_password=secret2 \
  -e PDNS_version_string=anonymous \
  -e PDNS_default_ttl=1500 \
  -e PDNS_allow_axfr_ips=172.5.0.21 \
  -e PDNS_only_notify=172.5.0.21 \
  pschiffe/pdns-mysql

Example of a slave server with a supermaster:

docker run -d -p 53:53 -p 53:53/udp --name pdns-slave \
  --hostname ns2.example.com --link mariadb:mysql \
  -e PDNS_gmysql_dbname=powerdnsslave \
  -e PDNS_secondary=yes \
  -e PDNS_autosecondary=yes \
  -e PDNS_version_string=anonymous \
  -e PDNS_disable_axfr=yes \
  -e PDNS_allow_notify_from=172.5.0.20 \
  -e SUPERMASTER_IPS=172.5.0.20 \
  pschiffe/pdns-mysql

pdns-pgsql

Docker Image Size (tag) Docker Image Size (tag) Docker Pulls

https://hub.docker.com/r/pschiffe/pdns-pgsql/

Docker image with PowerDNS 4.x server and postgres backend. Requires external postgres server. Env vars for pgsql configuration:

(name=default value)

PDNS_gpgsql_host=pgsql
PDNS_gpgsql_port=5432
PDNS_gpgsql_user=postgres
PDNS_gpgsql_password=powerdns
PDNS_gpgsql_dbname=powerdns

If linked with the official postgres image using the alias pgsql, the connection can be automatically configured, eliminating the need to specify any of the above. The DB is automatically initialized if tables are missing.

The PowerDNS server is configurable via env vars. Every variable starting with PDNS_ will be inserted into /etc/pdns/pdns.conf conf file in the following way: prefix PDNS_ will be stripped away and every _ will be replaced with -. For example, from the above pgsql config, PDNS_gpgsql_host=pgsql will became gpgsql-host=pgsql in /etc/pdns/pdns.conf file. This way, you can configure PowerDNS server in any way you need within a docker run command.

The SUPERMASTER_IPS env var is also supported, which can be used to configure supermasters for a slave DNS server. Docs. Multiple IP addresses separated by spaces should work.

You can find all the available settings here.

Examples

Example of a master server with the API enabled and one slave server configured:

docker run -d -p 53:53 -p 53:53/udp --name pdns-master \
  --hostname ns1.example.com --link postgres:pgsql \
  -e PDNS_primary=yes \
  -e PDNS_api=yes \
  -e PDNS_api_key=secret \
  -e PDNS_webserver=yes \
  -e PDNS_webserver_address=0.0.0.0 \
  -e PDNS_webserver_password=secret2 \
  -e PDNS_version_string=anonymous \
  -e PDNS_default_ttl=1500 \
  -e PDNS_allow_axfr_ips=172.5.0.21 \
  -e PDNS_only_notify=172.5.0.21 \
  pschiffe/pdns-pgsql

Example of a slave server with a supermaster:

docker run -d -p 53:53 -p 53:53/udp --name pdns-slave \
  --hostname ns2.example.com --link postgres:pgsql \
  -e PDNS_gpgsql_dbname=powerdnsslave \
  -e PDNS_secondary=yes \
  -e PDNS_autosecondary=yes \
  -e PDNS_version_string=anonymous \
  -e PDNS_disable_axfr=yes \
  -e PDNS_allow_notify_from=172.5.0.20 \
  -e SUPERMASTER_IPS=172.5.0.20 \
  pschiffe/pdns-pgsql

pdns-recursor

Docker Image Size (tag) Docker Image Size (tag) Docker Pulls

https://hub.docker.com/r/pschiffe/pdns-recursor/

Docker image with PowerDNS 5.x recursor.

PowerDNS recursor is configurable via env vars. Every variable starting with PDNS_ will be inserted into /etc/pdns/recursor.conf conf file in the following way: prefix PDNS_ will be stripped away and every _ will be replaced with -. For example, from the above mysql config, PDNS_gmysql_host=mysql will became gmysql-host=mysql in /etc/pdns/recursor.conf file. This way, you can configure PowerDNS recursor any way you need within a docker run command.

You can find all available settings here.

Example

Recursor server with API enabled:

docker run -d -p 53:53 -p 53:53/udp --name pdns-recursor \
  -e PDNS_api_key=secret \
  -e PDNS_webserver=yes \
  -e PDNS_webserver_address=0.0.0.0 \
  -e PDNS_webserver_password=secret2 \
  pschiffe/pdns-recursor

pdns-admin

Docker Image Size (tag) Docker Pulls

https://hub.docker.com/r/pschiffe/pdns-admin/

Docker image with PowerDNS Admin web app, written in Flask, for managing PowerDNS servers. It needs external mysql or postgres server.

There is also an official image for the pdns-admin on Docker Hub. That image contains only gunicorn process that handles both - static files and the python app. Image in this repo contains uWSGI server handling requests for python app and Caddy web server handling static files and optionally HTTPS with Let's Encrypt.

Env vars for mysql configuration:

(name=default value)

PDNS_ADMIN_SQLA_DB_HOST=mysql
PDNS_ADMIN_SQLA_DB_PORT=3306
PDNS_ADMIN_SQLA_DB_USER=root
PDNS_ADMIN_SQLA_DB_PASSWORD=powerdnsadmin
PDNS_ADMIN_SQLA_DB_NAME=powerdnsadmin

If linked with official mariadb image with alias mysql, the connection can be automatically configured, so you don't need to specify any of the above.

Env vars for pgsql configuration:

PDNS_ADMIN_SQLA_DB_TYPE=postgres
PDNS_ADMIN_SQLA_DB_HOST=pgsql
PDNS_ADMIN_SQLA_DB_PORT=5432
PDNS_ADMIN_SQLA_DB_USER=postgres
PDNS_ADMIN_SQLA_DB_PASSWORD=powerdnsadmin
PDNS_ADMIN_SQLA_DB_NAME=powerdnsadmin

The DB is automatically initialized if tables are missing.

Similar to the pdns-mysql, pdns-admin is also completely configurable via env vars. Prefix in this case is PDNS_ADMIN_, configuration will be written to the /opt/powerdns-admin/powerdnsadmin/default_config.py file.

Connecting to the PowerDNS server

For the pdns-admin to make sense, it needs a PowerDNS server to manage. The PowerDNS server needs to have exposed API (example configuration for PowerDNS 4.x):

api=yes
api-key=secret
webserver=yes
webserver-address=0.0.0.0
webserver-allow-from=172.5.0.0/16

And again, PowerDNS connection is configured via env vars (it needs url of the PowerDNS server, api key and a version of PowerDNS server, for example 4.0):

(name=default value)

PDNS_API_URL="http://pdns:8081/"
PDNS_API_KEY=""
PDNS_VERSION=""

If this container is linked with pdns-mysql from this repo with alias pdns, it will be configured automatically and none of the env vars from above are needed to be specified.

PowerDNS Admin API keys and SALT

In order to be able to generate an API Key, you will need to specify the SALT via PDNS_ADMIN_SALT env var. This is a secret value, which can be generated via command:

python3 -c 'import bcrypt; print(bcrypt.gensalt().decode("utf-8"));'

Example value looks like $2b$12$xxxxxxxxxxxxxxxxxxxxxx - remember that when using docker-compose, literal $ must be specified as $$.

SSL with Let's Encrypt

Included Caddy server can optionally handle HTTPS with certificates from Let's Encrypt. To make this work, add SSL_MAIN_DOMAIN env var with your primary domain for HTTPS. The SSL_EXTRA_DOMAINS env var can contain list of comma-separated domains that will be redirected to the SSL_MAIN_DOMAIN. Public DNS must be properly configured and pdns-admin ports 8080, 8443 and 8443/udp must be exposed as 80, 443 and 443/udp (443/udp is for HTTP/3 traffic).

Finally, make the /var/lib/caddy dir inside of the pdns-admin container persistent - that's where the generated certificates will be stored.

Persistent data

There is also a directory with user uploads which should be persistent: /opt/powerdns-admin/upload

Examples

When linked with pdns-mysql from this repo:

docker run -d -p 8080:8080 --name pdns-admin \
  --link mariadb:mysql --link pdns-master:pdns \
  -v pdns-admin-upload:/opt/powerdns-admin/upload \
  pschiffe/pdns-admin

The same with HTTPS:

docker run -d -p 80:8080 -p 443:8443 -p 443:8443/udp --name pdns-admin \
  --link mariadb:mysql --link pdns-master:pdns \
  -v pdns-admin-caddy:/var/lib/caddy \
  -v pdns-admin-upload:/opt/powerdns-admin/upload \
  -e SSL_MAIN_DOMAIN=www.pdns-admin.com \
  -e SSL_EXTRA_DOMAINS=pdns-admin.com,pdns-admin.eu \
  pschiffe/pdns-admin

Docker Compose

Included docker compose files contain example configuration of how to use these containers:

docker-compose -f docker-compose-mysql.yml up -d

Ansible playbook

Included ansible playbooks can be used to build and run the containers from this repo. Run it with:

ansible-playbook ansible-playbook-mysql.yml

docker-pdns's People

Contributors

almereyda avatar aneagoe avatar bahag-schlachterk avatar dependabot[bot] avatar draga79 avatar floored1585 avatar harryzcy avatar jkjameson avatar murphy83 avatar poppypop avatar pschiffe avatar tafkam avatar theel0ja avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-pdns's Issues

docker-cmd.sh if test fails for pdns-recursor

alpine container fails in the entrypoint:

/ # sh -x docker-cmd.sh 
+ set -euo pipefail
+ : 53
+ : 0.0.0.0
+ export PDNS_local_port PDNS_local_address
+ envtpl
+ '[' getent passwd
sh: missing ]
+ grep -c ^pdns-recursor: ]
grep: ]: No such file or directory
+ chown recursor:recursor /etc/pdns/recursor.conf
+ exec /usr/sbin/pdns_recursor
Oct 25 12:25:07 PowerDNS Recursor 4.1.3 (C) 2001-2018 PowerDNS.COM BV
...

The problem seems to be down to the definition of the if statement. I will follow up shortly with a PR to fix this.

docker-compose uwsgi - error

Hello.
I have problem with run uwsgi with docker-compose.
My docker-compose.yml
My .env

I i try up this, i got error:

pdns-admin-uwsgi_1  |   File "/opt/powerdns-admin/create_db.py", line 6, in <module>
pdns-admin-uwsgi_1  |     from app import db
pdns-admin-uwsgi_1  |   File "/opt/powerdns-admin/app/__init__.py", line 52, in <module>
pdns-admin-uwsgi_1  |     from app import views, models
pdns-admin-uwsgi_1  |   File "/opt/powerdns-admin/app/views.py", line 17, in <module>
pdns-admin-uwsgi_1  |     from .models import User, Domain, Record, Server, History, Anonymous, Setting, Language, DomainSetting, Page
pdns-admin-uwsgi_1  |   File "/opt/powerdns-admin/app/models.py", line 44, in <module>
pdns-admin-uwsgi_1  |     API_EXTENDED_URL = utils.pdns_api_extended_uri(PDNS_VERSION)
pdns-admin-uwsgi_1  |   File "/opt/powerdns-admin/app/lib/utils.py", line 146, in pdns_api_extended_uri
pdns-admin-uwsgi_1  |     if StrictVersion(version) >= StrictVersion('4.0.0'):
pdns-admin-uwsgi_1  |   File "/usr/lib64/python2.7/distutils/version.py", line 140, in __cmp__
pdns-admin-uwsgi_1  |     compare = cmp(self.version, other.version)
pdns-admin-uwsgi_1  | AttributeError: StrictVersion instance has no attribute 'version'

Please, help me. :)
(Sory for my English)

nginx error with pdns-admin-uwsgi and pdns-admin-static

I have a server running Docker version 17.04.0-ce that has pdns-admin running in a container. I used the pschiffe/docker-pdns image, which works fine when launched as follows:

docker run -dt -P --name pdns-admin \
  --privileged \
  -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
  -e PDNS_ADMIN_SQLA_DB_HOST="'10.a.b.c'" \
  -e PDNS_ADMIN_SQLA_DB_PORT="'3306'" \
  -e PDNS_ADMIN_SQLA_DB_USER="'pdnsdbuser'" \
  -e PDNS_ADMIN_SQLA_DB_PASSWORD="'mysqlsupersecret'" \
  -e PDNS_ADMIN_SQLA_DB_NAME="'pdnsadmin'" \
  -e PDNS_ADMIN_PDNS_STATS_URL="'http://10.x.y.z:8081/'" \
  -e PDNS_ADMIN_PDNS_API_KEY="'somelongkey'" \
  -e PDNS_ADMIN_PDNS_VERSION="'4.0.0'" \
  -e PDNS_ADMIN_LDAP_TYPE="'ldap'" \
  -e PDNS_ADMIN_LDAP_URI="'ldaps://ldap.mycompany.com:636'" \
  -e PDNS_ADMIN_LDAP_USERNAME="'[email protected],ou=people,dc=mycompany,dc=com'" \
  -e PDNS_ADMIN_LDAP_PASSWORD="'ldapsecretpass'" \
  -e PDNS_ADMIN_LDAP_SEARCH_BASE="'ou=People,dc=mycompany,dc=com'" \
  -e PDNS_ADMIN_LDAP_USERNAMEFIELD="'uid'" \
  -e PDNS_ADMIN_LDAP_FILTER="'(accessRole=uniqueIdentifier=pdnsadmin,ou=roles)'" \
  pschiffe/pdns-admin

I have a separate Docker server, which has been upgraded to version 17.09.0-ce. When the pdns-admin container is launched with the same parameters above, it doesn't work properly. Here is log output when the container is started

systemd 233 running in system mode. (+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN default-hierarchy=hybrid)
Detected virtualization docker.
Detected architecture x86-64.

Welcome to Fedora 26 (Twenty Six)!

Set hostname to <8e19df351cbb>.
Initializing machine ID from random generator.
[ INFO ] Unnecessary job for /dev/sda1 was removed.
[  OK  ] Reached target Remote File Systems.
[  OK  ] Started Dispatch Password Requests to Console Directory Watch.
[  OK  ] Reached target Swap.
[  OK  ] Set up automount Arbitrary Executabโ€ฆrmats File System Automount Point.
[  OK  ] Listening on Journal Socket (/dev/log).
[  OK  ] Listening on Journal Socket.
[  OK  ] Listening on Process Core Dump Socket.
[  OK  ] Listening on /dev/initctl Compatibility Named Pipe.
[  OK  ] Started Forward Password Requests to Wall Directory Watch.
[  OK  ] Reached target Encrypted Volumes.
[  OK  ] Reached target Paths.
[  OK  ] Created slice System Slice.
         Mounting Configuration File System...
         Starting Journal Service...
         Starting Apply Kernel Variables...
         Starting Create System Users...
[  OK  ] Reached target Slices.
         Mounting Debug File System...
tmp.mount: Directory /tmp to mount over is not empty, mounting anyway.
         Mounting Temporary Directory...
[  OK  ] Started Apply Kernel Variables.
[  OK  ] Started Create System Users.
[  OK  ] Mounted Configuration File System.
[  OK  ] Mounted Debug File System.
[  OK  ] Mounted Temporary Directory.
[  OK  ] Reached target Local File Systems.
         Starting Rebuild Journal Catalog...
         Starting Rebuild Dynamic Linker Cache...
[426335.069289] [systemd-sysctl  OK  [25]: ] Couldn't write '0' to 'kernel/yama/ptrace_scope', ignoring: No such file or directoryStarted Journal Service.

[426335.069435] systemd-sysctl[25]: Couldn't write 'fq_codel' to 'net/core/default_qdisc', ignoring: No such file or directory
         Starting Flush Journal to Persistent Storage...
[426335.069869] systemd[1]: Starting Flush Journal to Persistent Storage...

When I browse to http://hostip:port, I get the big "nginx error" page. Also, I don't see anything streaming in the container logs when I try to hit it.

Since I see that the pdns-admin image is now deprecated, I tried to use the newer pdns-admin-uwsgi and pdns-admin-static images. This is how they were launched...

Started pdns-admin-uwsgi

docker run -dt --name pdns-admin-uwsgi \
  --privileged \
  -v pdns-admin-upload:/opt/powerdns-admin/upload \
  -e PDNS_ADMIN_SQLA_DB_HOST="'10.x.x.x'" \
  -e PDNS_ADMIN_SQLA_DB_PORT="'3306'" \
  -e PDNS_ADMIN_SQLA_DB_USER="'pdnsdbuser'" \
  -e PDNS_ADMIN_SQLA_DB_PASSWORD="'mysqlsupersecret'" \
  -e PDNS_ADMIN_SQLA_DB_NAME="'pdnsadmin'" \
  -e PDNS_ADMIN_PDNS_STATS_URL="'http://10.x.x.x:8081/'" \
  -e PDNS_ADMIN_PDNS_API_KEY="'somelongkey'" \
  -e PDNS_ADMIN_PDNS_VERSION="'4.0.0'" \
  -e PDNS_ADMIN_LDAP_TYPE="'ldap'" \
  -e PDNS_ADMIN_LDAP_URI="'ldaps://ldap.mycompany.com:636'" \
  -e PDNS_ADMIN_LDAP_USERNAME="'[email protected],ou=people,dc=mycompany,dc=com'" \
  -e PDNS_ADMIN_LDAP_PASSWORD="'ldapsecretpass'" \
  -e PDNS_ADMIN_LDAP_SEARCH_BASE="'ou=People,dc=mycompany,dc=com'" \
  -e PDNS_ADMIN_LDAP_USERNAMEFIELD="'uid'" \
  -e PDNS_ADMIN_LDAP_FILTER="'(accessRole=uniqueIdentifier=pdnsadmin,ou=roles)'" \
  pschiffe/pdns-admin-uwsgi

Log output:

[uWSGI] getting INI configuration from /etc/uwsgi.ini
setting capability setgid [6]
setting capability setuid [7]
*** Starting uWSGI 2.0.15 (64bit) on [Mon Oct  9 19:43:05 2017] ***
compiled with version: 7.1.1 20170503 (Red Hat 7.1.1-1) on 19 May 2017 15:43:52
os: Linux-3.10.0-327.10.1.el7.x86_64 #1 SMP Tue Feb 16 17:03:50 UTC 2016
nodename: 9c7a727ecc74
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 4
current working directory: /opt/powerdns-admin
writing pidfile to /run/uwsgi/uwsgi.pid
detected binary path: /usr/sbin/uwsgi
setgid() to 996
setuid() to 997
your memory page size is 4096 bytes
detected max file descriptor number: 65536
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
your mercy for graceful operations on workers is 60 seconds
*** Operational MODE: no-workers ***
spawned uWSGI master process (pid: 1)
*** Stats server enabled on /run/uwsgi/stats.sock fd: 6 ***
*** starting uWSGI Emperor ***
[emperor-tyrant] dropping privileges to 997 996 for instance pdns-admin.ini
*** has_emperor mode detected (fd: 6) ***
[uWSGI] getting INI configuration from pdns-admin.ini
*** Starting uWSGI 2.0.15 (64bit) on [Mon Oct  9 19:43:05 2017] ***
compiled with version: 7.1.1 20170503 (Red Hat 7.1.1-1) on 19 May 2017 15:43:52
os: Linux-3.10.0-327.10.1.el7.x86_64 #1 SMP Tue Feb 16 17:03:50 UTC 2016
nodename: 9c7a727ecc74
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 4
current working directory: /etc/uwsgi.d
writing pidfile to /run/uwsgi/pdns-admin.pid
detected binary path: /usr/sbin/uwsgi
chdir() to /opt/powerdns-admin
your memory page size is 4096 bytes
detected max file descriptor number: 65536
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 0.0.0.0:9494 fd 3
Python version: 2.7.13 (default, Sep  5 2017, 08:53:59)  [GCC 7.1.1 20170622 (Red Hat 7.1.1-3)]
Python main interpreter initialized at 0x11abc40
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 161920 bytes (158 KB) for 1 cores
*** Operational MODE: single process ***
added /opt/powerdns-admin/ to pythonpath.
mounting run.py on /
WSGI app 0 (mountpoint='/') ready in 2 seconds on interpreter 0x11abc40 pid: 18 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 18)
Mon Oct  9 19:43:08 2017 - [emperor] vassal pdns-admin.ini has been spawned
spawned uWSGI worker 1 (pid: 20, cores: 1)
Mon Oct  9 19:43:08 2017 - [emperor] vassal pdns-admin.ini is ready to accept requests

...and then started pdns-admin-static...

docker run -dt -p 8999:80 --name pdns-admin-static \
  --link pdns-admin-uwsgi:pdns-admin-uwsgi \
  pschiffe/pdns-admin-static

I get a 502 when trying to hit it in my browser. Log output...

2017/10/09 19:46:33 [error] 7#7: *1 upstream prematurely closed connection while reading response header from upstream, client: 10.x.x.x, server: localhost, request: "GET / HTTP/1.1", upstream: "uwsgi://172.17.0.7:9494", host: "dockerhost.mycompany.com:8999"
10.x.x.x - - [09/Oct/2017:19:46:33 +0000] "GET / HTTP/1.1" 502 537 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36" "-"
2017/10/09 19:46:33 [error] 7#7: *1 upstream prematurely closed connection while reading response header from upstream, client: 10.x.x.x, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "uwsgi://172.17.0.7:9494", host: "dockerhost.mycompany.com:8999", referrer: "http://dockerhost.mycompany.com:8999/"
10.x.x.x - - [09/Oct/2017:19:46:33 +0000] "GET /favicon.ico HTTP/1.1" 502 537 "http://dockerhost.mycompany.com:8999/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36" "-"
2017/10/09 19:46:45 [error] 7#7: *1 upstream prematurely closed connection while reading response header from upstream, client: 10.29.23.25, server: localhost, request: "GET / HTTP/1.1", upstream: "uwsgi://172.17.0.7:9494", host: "dockerhost.mycompany.com:8999"
10.x.x.x - - [09/Oct/2017:19:46:45 +0000] "GET / HTTP/1.1" 502 537 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36" "-"
2017/10/09 19:46:45 [error] 7#7: *1 upstream prematurely closed connection while reading response header from upstream, client: 10.29.23.25, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "uwsgi://172.17.0.7:9494", host: "dockerhost.mycompany.com:8999", referrer: "http://dockerhost.mycompany.com:8999/"
10.x.x.x - - [09/Oct/2017:19:46:45 +0000] "GET /favicon.ico HTTP/1.1" 502 537 "http://dockerhost.mycompany.com:8999/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36" "-"

I have no idea what I'm doing wrong. Have tried a few different things, but can't quite figure this out. Any ideas or solutions would be much appreciated!

Canยดt add domain

Hi !
I just installed the stack on a brand new docker and I find myself unable to add a domain, it returns me a 400.
Could you help me to solve the problem ?

Log :

Aug 04 20:41:17 Guardian is launching an instance
Aug 04 20:41:17 Loading '/usr/lib64/pdns/libgmysqlbackend.so'
Aug 04 20:41:17 This is a guarded instance of pdns
Aug 04 20:41:17 Fatal error: Database error trying to retrieve all domains:Could not prepare statement: select domains.id, domains.name, records.content, domains.type, domains.master, domains.notified_serial, domains.last_check, domains.account from domains LEFT JOIN records ON records.domain_id=domains.id AND records.type='SOA' AND records.name=domains.name WHERE records.disabled=0 OR ?: Table 'powerdnsadmin.domains' doesn't exist
Aug 04 20:41:18 Our pdns instance exited with code 1, respawning

4.6 support?

Hi there,

Is there any plan to support 4.6?
It's in package mirrors yet and it' the default version when installing on top of Rocky Linux for example.

Thanks !

Question?: are LUA records enabled or I'm doing it wrong?

Hello,
I'm currently evaluating a new dns setup for my msp with powerdns. To keep matters simple we will use a bunch of clustered debian vms with powerdns running under docker (for easy updates). The feature that is at the center of evaluation is the ability of load balancing using LUA scripts and powerdns port check (https://doc.powerdns.com/authoritative/lua-records/index.html).
So I powered up an instance of pdns-mysql + db + powerdns admin and created a test domain (example.com), then assigned two A records (test.example.com) to two different ips (ex 192.168.0.10 192.168.0.11) and added a LUA record (A "ifportup(80, {'192.168.0.10', '192.168.0.11'})". After this I turned off the vm with ip 192.168.0.10, waited 60s and then asked the server a query for test.example.com. At first the server responded 192.168.0.11, but after 5 minutes it switched to 192.168.0.10...
Is this the right method? Do I need a recursor in front of this setup? Or are LUA records disabled?
Thank you in advance!

Fatal error: Trying to set unknown parameter 'ADMIN-PORT'

Hi,

I am unable to start PDNS in kubernetes.

below is the recurring error I am facing with alpine image.

Oct 31 18:41:01 Guardian is launching an instance
Oct 31 18:41:01 Loading '/usr/lib/pdns/pdns/libgmysqlbackend.so'
Oct 31 18:41:01 This is a guarded instance of pdns
Oct 31 18:41:01 Fatal error: Trying to set unknown parameter 'ADMIN-PORT'
Oct 31 18:41:02 Our pdns instance exited with code 1, respawning

Please let me know what is the issue with the deployment.

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: pdns
    type: dns
  name: pdns-deployment
  namespace: dns
spec:
  selector:
    matchLabels:
      app: pdns
      type: dns
  template:
    metadata:
      labels:
        app: pdns
        type: dns
    spec:
      hostAliases:
      - ip: "127.0.0.1"
        hostnames:
        - "pdns-admin-uwsgi"
      containers:
      - image: pschiffe/pdns-mysql:alpine
        imagePullPolicy: IfNotPresent
        name: pdns-master
        env:
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        - name: PDNS_gmysql_host
          value: "mysql.db"
        - name: PDNS_gmysql_port
          value: "3306"
        - name: PDNS_gmysql_user
          valueFrom:
            secretKeyRef:
              name: pdns-secret
              key: mysqluser
        - name: PDNS_gmysql_password
          valueFrom:
            secretKeyRef:
              name: pdns-secret
              key: mysqlpass
        - name: PDNS_gmysql_dbname
          value: "power_dns_live"
        - name: PDNS_version_string
          value: "anonymous"
        - name: PDNS_master
          value: "yes"
        - name: PDNS_api
          value: "yes"
        - name: PDNS_api_key
          valueFrom:
            secretKeyRef:
              name: pdns-secret
              key: apikey
        - name: PDNS_webserver
          value: "yes"
        - name: PDNS_webserver_address
          value: "0.0.0.0"
        - name: PDNS_webserver_allow_from
          value: "127.0.0.1/32 10.244.0.0/16 10.32.0.0/16"
        - name: PDNS_webserver_password
          valueFrom:
            secretKeyRef:
              name: pdns-secret
              key: webserver
        - name: PDNS_default_ttl
          value: "1500"
        - name: PDNS_soa_minimum_ttl
          value: "1200"
        - name: PDNS_default_soa_name
          value: "ns1.vjs.net.in"
        - name: PDNS_default_soa_mail
          value: "dnsmaster.vjs.net.in"
        - name: PDNS_allow_axfr_ips
          value: "10.0.0.2 10.0.0.3"
        - name: PDNS_only_notify
          value: "10.0.0.2 10.0.0.3"
        - name: PDNS_dnsupdate
          value: "yes"
        - name: PDNS_allow_dnsupdate_from
          value: "10.0.0.1/32 127.0.0.1/32 10.244.0.0/16 10.32.0.0/16"
        resources:
          limits:
            cpu: 300m
            memory: 256Mi
          requests:
            cpu: 50m
            memory: 128Mi
      - name: pdns-admin-static
        image: pschiffe/pdns-admin-static:ngoduykhanh
        imagePullPolicy: IfNotPresent
        resources:
          limits:
            cpu: 300m
            memory: 128Mi
          requests:
            cpu: 50m
            memory: 64Mi
      - name: pdns-admin-uwsgi
        image: pschiffe/pdns-admin-uwsgi:ngoduykhanh
        imagePullPolicy: IfNotPresent
        env:
        - name: PDNS_ADMIN_SQLA_DB_HOST
          value: "'mysql.db'"
        - name: PDNS_ADMIN_SQLA_DB_PORT
          value: "'3306'"
        - name: PDNS_ADMIN_SQLA_DB_USER
          valueFrom:
            secretKeyRef:
              name: pdns-secret
              key: quotedmysqluser
        - name: PDNS_ADMIN_SQLA_DB_PASSWORD
          valueFrom:
            secretKeyRef:
              name: pdns-secret
              key: quotedmysqlpass
        - name: PDNS_ADMIN_SQLA_DB_NAME
          value: "'power_dns_admin_live'"
        - name: PDNS_API_URL
          value: "http://localhost:8081/"
        - name: PDNS_VERSION
          value: "4.2.1"
        - name: PDNS_API_KEY
          valueFrom:
            secretKeyRef:
              name: pdns-secret
              key: apikey
        volumeMounts:
          - name: uploads
            mountPath: /opt/powerdns-admin/upload/
        resources:
          limits:
            cpu: 300m
            memory: 128Mi
          requests:
            cpu: 50m
            memory: 64Mi
      volumes:
        - name: uploads
          persistentVolumeClaim:
            claimName: pdns-admin-pvc
      dnsPolicy: ClusterFirstWithHostNet
      restartPolicy: Always
      terminationGracePeriodSeconds: 30

Communication from recursor to pdns-master not working

I am trying to get PDNS-Master, slave and a recursor. I have a problem connecting from recursor to the PDNS-Master. If I have the recursor running on the host itself it is working fine.
I have to admit that my docker skills are still in alpha stage but continuously improving. All containers are starting just fine. I just don't get how to get the connection from pdns-recursor to pdns-master.

6390ab2e3a87        pschiffe/pdns-recursor   "/docker-entrypoint.โ€ฆ"   4 minutes ago       Up 4 minutes        0.0.0.0:53->53/tcp, 0.0.0.0:53->53/udp                                               pdns_pdns-recursor_1
07dea80ce338        pschiffe/pdns-mysql      "/docker-entrypoint.โ€ฆ"   11 minutes ago      Up 4 minutes        0.0.0.0:8081->8081/tcp, 0.0.0.0:5300->53/tcp, 0.0.0.0:5300->53/udp                   pdns_pdns-master_1
269ae7008c81        mariadb:latest           "docker-entrypoint.sโ€ฆ"   11 minutes ago      Up 4 minutes        3306/tcp                                                                             pdns_db_1

Usually containers communicate to each other via links like

links:

  • pdns-master

but here in this case when I try to pass the config to recursor:

Recursor env:

      PDNS_dnssec: 'process-no-validate'
      PDNS_forward_zones: 'test.mydomain.com=pdns-master'
      PDNS_forward_zones_recurse: '.=8.8.8.8;8.8.4.4'

Log Output:

May 23 16:05:00 Redirecting queries for zone 'test.mydomain.com' to: Exception: Unable to convert presentation address 'pdns-master'

When I use the docker host IP address to connect to pdns-master I get a timeout
Recursor env:

      PDNS_dnssec: 'process-no-validate'
      PDNS_forward_zones: 'test.mydomain.com=10.222.125.126:5300'
      PDNS_forward_zones_recurse: '.=8.8.8.8;8.8.4.4'

Recursor log

 May 23 16:10:40 Redirecting queries for zone 'test.mydomain.com' to: 10.222.125.126:5300

But DNS lookup results into a timeout via recursor. When i do a lookup from the docker host machine to 10.222.125.126:5300 directly it works fine. So i went into the container and have realized that in pdns-recursor i am able to telnet 10.222.125.126:5300 but telnet drops after a couple of seconds.

When I use the IP address of the container pdns-master directly it works just fine. Looking at your ansible playbook you assign static IPs to your container. Is that necessary in order to get it work?

Any help is appreciated. Although I might have not a 100% clear understanding why my setup doesnt work.

I hope you can help.

Thanks
Chris

*** EDIT ***

I just tried the first IP of the created network in this case it was 172.21.0.1 with exposed port 5300

Recursor env:

      PDNS_dnssec: 'process-no-validate'
      PDNS_forward_zones: 'test.mydomain.com=172.21.0.1:5300'
      PDNS_forward_zones_recurse: '.=8.8.8.8;8.8.4.4'

or

DIrect container recursor env:

      PDNS_dnssec: 'process-no-validate'
      PDNS_forward_zones: 'test.mydomain.com=172.21.0.3:53'
      PDNS_forward_zones_recurse: '.=8.8.8.8;8.8.4.4'

Both scenarios work. Is there a better way to solve this without adding static api addresses and only with the use of links?

Empty Response from API

Hey Guys,

I spun up the mysql/power dns server on our system to test, and it's running perfectly.
The only issue I'm having is that any api call to it, is getting an empty response error...

The variables:
powerdns:
image: pschiffe/pdns-mysql
ports:
- 53:53
- 8001:8001
environment:
- PDNS_master=yes
- PDNS_api=yes
- PDNS_api_key=SecurePassword
- PDNS_webserver=yes
- PDNS_webserver_address=10.0.0.231
- PDNS_webserver_password=SecurePassword
- PDNS_version_string=anonymous
- PDNS_default_ttl=1500
- PDNS_gmysql_host=db
- PDNS_gmysql_port=3306
- PDNS_gmysql_user=root
- PDNS_gmysql_password=SecurePassword
- PDNS_gmysql_dbname=powerdns

The API error when calling it:
cURL error 52: Empty reply from server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://node1:8001/api/v1/servers/localhost/zones

any advise as to what may be wrong?

Fatal Error: Unable to acquire TCP socket: Address family not supported by protocol

pdns-master seems to be in crashloop when i have disabled IPv6 on the host. I can't get it working for some time :/ any help would be appreciated.

Oct 18 11:20:16 Guardian is launching an instance
Oct 18 11:20:16 Loading '/usr/lib64/pdns/libgmysqlbackend.so'
Oct 18 11:20:16 This is a guarded instance of pdns
Oct 18 11:20:16 UDP server bound to 0.0.0.0:53
Oct 18 11:20:16 Binding [::]:53: Address Family is not supported - skipping bind
Oct 18 11:20:16 TCP server bound to 0.0.0.0:53
Oct 18 11:20:16 Fatal error: Unable to acquire TCP socket: Address family not supported by protocol
Oct 18 11:20:17 Our pdns instance exited with code 1, respawning

pdns-admin-uwsgi python error

Getting the following error while deploying pdns-admin-uwsgi

Traceback (most recent call last):
pdns-admin-uwsgi    |   File "/opt/powerdns-admin/create_db.py", line 6, in <module>
pdns-admin-uwsgi    |     from app import db
pdns-admin-uwsgi    |   File "/opt/powerdns-admin/app/__init__.py", line 52, in <module>
pdns-admin-uwsgi    |     from app import views, models
pdns-admin-uwsgi    |   File "/opt/powerdns-admin/app/views.py", line 17, in <module>
pdns-admin-uwsgi    |     from .models import User, Domain, Record, Server, History, Anonymous, Setting, Language, DomainSetting, Page
pdns-admin-uwsgi    |   File "/opt/powerdns-admin/app/models.py", line 44, in <module>
pdns-admin-uwsgi    |     API_EXTENDED_URL = utils.pdns_api_extended_uri(PDNS_VERSION)
pdns-admin-uwsgi    |   File "/opt/powerdns-admin/app/lib/utils.py", line 146, in pdns_api_extended_uri
pdns-admin-uwsgi    |     if StrictVersion(version) >= StrictVersion('4.0.0'):
pdns-admin-uwsgi    |   File "/usr/lib64/python2.7/distutils/version.py", line 140, in __cmp__
pdns-admin-uwsgi    |     compare = cmp(self.version, other.version)
pdns-admin-uwsgi    | AttributeError: StrictVersion instance has no attribute 'version'

What can I do to fix this?

pdns-admin-uwsgi docker-compose error

Hello, i get this error start services with docker-compose:

Traceback (most recent call last):
File "/opt/powerdns-admin/create_db.py", line 6, in
from app import db
File "/opt/powerdns-admin/app/init.py", line 52, in
from app import views, models
File "/opt/powerdns-admin/app/views.py", line 17, in
from .models import User, Domain, Record, Server, History, Anonymous, Setting, Language, DomainSetting, Page
File "/opt/powerdns-admin/app/models.py", line 44, in
API_EXTENDED_URL = utils.pdns_api_extended_uri(PDNS_VERSION)
File "/opt/powerdns-admin/app/lib/utils.py", line 146, in pdns_api_extended_uri
if StrictVersion(version) >= StrictVersion('4.0.0'):
File "/usr/lib64/python2.7/distutils/version.py", line 140, in cmp
compare = cmp(self.version, other.version)
AttributeError: StrictVersion instance has no attribute 'version'

Docker-compose canยดt add domain

Hi

I tried to use this docker-compose file to setup powerdns from this url with docker-compose. The problem is that when i add a volume to mysql i canยดt add a domain from powerdns-admin, i get the error 400. If i remove the volume from mysql then i can add a domain.

I also tried to use this with docker run and was able to run it successfully, but i want to use docker-compose if possible.

pdns-admin-uwsgi issue with nginx reverse proxy

Hi again!

When using the pdns-admin-uwsgi and pdns-admin-static containers, linking them as instructed in the README, it works perfectly. I can access the app at http://dockerhost.mycompany.com:8999 and all seems fine.

However, I already have a separate docker host running nginx proxy containers, and I'd like to use this instead of the pdns-admin-static container. I am publishing a port on the pdns-admin-uwsgi container as such:

docker run -dt -p 9494:9494 --name pdns-admin-uwsgi \
  --privileged \
  -v pdns-admin-upload:/opt/powerdns-admin/upload \
  -e PDNS_ADMIN_SQLA_DB_HOST="'10.x.x.x'" \
  -e PDNS_ADMIN_SQLA_DB_PORT="'3306'" \
  -e PDNS_ADMIN_SQLA_DB_USER="'pdnsdbuser'" \
  -e PDNS_ADMIN_SQLA_DB_PASSWORD="'mysqlsupersecret'" \
  -e PDNS_ADMIN_SQLA_DB_NAME="'pdnsadmin'" \
  -e PDNS_ADMIN_PDNS_STATS_URL="'http://10.x.x.x:8081/'" \
  -e PDNS_ADMIN_PDNS_API_KEY="'somelongkey'" \
  -e PDNS_ADMIN_PDNS_VERSION="'4.0.0'" \
  -e PDNS_ADMIN_LDAP_TYPE="'ldap'" \
  -e PDNS_ADMIN_LDAP_URI="'ldaps://ldap.mycompany.com:636'" \
  -e PDNS_ADMIN_LDAP_USERNAME="'[email protected],ou=people,dc=mycompany,dc=com'" \
  -e PDNS_ADMIN_LDAP_PASSWORD="'ldapsecretpass'" \
  -e PDNS_ADMIN_LDAP_SEARCH_BASE="'ou=People,dc=mycompany,dc=com'" \
  -e PDNS_ADMIN_LDAP_USERNAMEFIELD="'uid'" \
  -e PDNS_ADMIN_LDAP_FILTER="'(accessRole=uniqueIdentifier=pdnsadmin,ou=roles)'" \
  pschiffe/pdns-admin-uwsgi

The location blocks of my nginx conf looks like this:

location /static/ {
  alias /opt/powerdns-admin/app/static/;
}

location / {
  try_files $uri @pdns_admin;
}

location @pdns_admin {

  include            uwsgi_params;
  uwsgi_pass         backend;

  uwsgi_param        Host $http_host;
  uwsgi_param        X-Real-IP $remote_addr;
  uwsgi_param        X-Forwarded-For $proxy_add_x_forwarded_for;
  uwsgi_param        X-Forwarded-Proto $scheme;
}

When I hit the proxy through my browser, it does return data and I can login, see zones, etc... but the HTML is ugly and isn't formatted. I see things like this in the nginx logs:

10.29.23.25 - - [11/Oct/2017:16:46:17 +0000] "GET /static/custom/js/select2.min.js HTTP/1.1" 404 571 "https://dockerproxy.mycompany.com:32000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36" "-"
2017/10/11 16:46:17 [error] 16#16: *2 open() "/opt/powerdns-admin/app/static/custom/js/select2.min.js" failed (2: No such file or directory), client: 10.x.x.x, server: *.mycompany.com, request: "GET /static/custom/js/select2.min.js HTTP/1.1", host: "dockerproxy.mycompany.com:32000", referrer: "https://dockerproxy.mycompany.com:32000/"

I shelled into the pdns-admin-uwsgi container and cd'd to /opt/powerdns-admin/app... sure enough, the entire static directory is missing! I do see the directory here

I'm confused as to how this works via the static container, but not my proxy. Any ideas as to how I can get this working?

Deploying Authoritative and Recursive DNS on the same VM with Master-Slave capabillity

Hi @pschiffe, i want to deploy pdns in docker with master-slave feature. Authoritative and Recursive DNS need to be on the same VM.

Infrastructure details:
VM1 (pdns-master): Rocky Linux 8.7 - 10.x.x.110
VM2 (pdns-slave): Rocky Linux 8.7 - 10.x.x.210

Can you provide me docker-compose.yml file for deploy PDNS in this way or can you help me with writing it.

I was trying do it alone,using your resources and few other, but with no success.

Thank you in advance.

/docker-entrypoint.sh: line 32: PDNS_gmysql_socket: unbound variable

Just started getting /docker-entrypoint.sh: line 32: PDNS_gmysql_socket: unbound variable errors after an image auto-update

I've not defined PDNS_gmysql_socket under environment in my docker-compose.yaml

Was working fine with just remote host, port, user, password, and dbname defined before todays update

Problem with "Global Search" on web-interface

Hi, how are u? :)

I have an problem with the feature "global search", where doesn't list the domains/records via api.

follow the logs of the problem:

HTTP ISE for "/api/v1/servers/localhost/search-data": Exception: GSQLBackend unable to execute query: Could not get next result from mysql statement: SELECT content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE name LIKE ? OR content LIKE ? LIMIT ?: Commands out of sync; you can't run this command now

if i use the follow command:

curl -H 'X-API-Key: XXXXXX' http://X.X.X.X:8081/api/v1/servers/localhost/zones

this return all zones ihave records in my database.

My enviroment is:
(docker enviroment)

pdns-admin-static front
pdns-admin-uwsgi back
Mariadb version: Ver 15.1 Distrib 10.3.18-MariaDB
Powerdns-server: 4.1.6 - debian buster

Do u can help me?

Regards

uwsgi image error: invalid request block size:

Hii

First I'd like to thank you for producing the docker image for pdns-admin-uwsgi. :) I'm a complete novice about anything to do with docker but I wanted to run this for managing my PowerDNS server(s).

My first attempt was to install powerdns-admin directly on a CentOS7 VM to see how it worked, that was OK but the following problem arose.
I currently run several powerdns server and the datebase in use is mysql (Percon XtraDB) cluster, I normally access them through proxysql as a HA interface to the cluster, it's working quite well. The first problem is that powerdns-admin doesn't seem to like accessing the DB through proxysql and appears to get no response.

To get round that I connected directly to the DB via one of the cluster members, that seems to be no problem. I know this isn't specifically a problem with your container but thought I'd mention it.

Anyway onto the specific problem, the container starts OK with the following command:

docker run -dt -p 9494:9494 --name pdns-admin-uwsgi
--privileged
-v pdns-admin-upload:/opt/powerdns-admin/upload
-e SECRET_KEY="'asecretkey'"
-e PDNS_ADMIN_SQLA_DB_USER="'pdns_admin'"
-e PDNS_ADMIN_SQLA_DB_PASSWORD="'asecurepassword'"
-e PDNS_ADMIN_SQLA_DB_HOST="'192.168.1.10'"
-e PDNS_ADMIN_SQLA_DB_PORT="'3306'"
-e PDNS_ADMIN_SQLA_DB_NAME="'powerdnsadmin'"
-e PDNS_ADMIN_PDNS_STATS_URL="'http://192.168.1.10:8081/'"
-e PDNS_ADMIN_PDNS_API_KEY="'asecurekey"
-e PDNS_ADMIN_PDNS_VERSION="'4.1.0'"
pschiffe/pdns-admin-uwsgi

At this point it appears to be listening only on the ipv6 port 9494:

netstat -tulnp | grep 94
tcp6 0 0 :::9494 :::* LISTEN 28378/docker-proxy-

If I try to access the port 9494 I see the following error:

Thu Dec 28 15:41:58 2017 - [emperor] vassal pdns-admin.ini has been spawned
spawned uWSGI worker 1 (pid: 19, cores: 1)
Thu Dec 28 15:41:58 2017 - [emperor] vassal pdns-admin.ini is ready to accept requests
invalid request block size: 21573 (max 4096)...skip
invalid request block size: 21573 (max 4096)...skip

Have a missed something glaringly obvious or is this a problem with the container? As I mentioned earlier this container is running on a centos7 VM in VMware Workstation 14 (just for testing).

If there's anything else I need to provide, just let me know.

Regards

Bill

where is docker-compose file to tie this altogether?

would be great to have a docker-compose file to just spin this all up

in the documentation/readme you mentioned https://github.com/pschiffe/docker-pdns#example

where you referenced --link pdns-master:pdns but no where in there did you mention how to run the pdns-master container.
why did you omit this critical and important piece of the whole thing?
without that nothing will work and the point of the documentation is defeated

again a docker-compose file will help solve 99% of issues people will have running this

Access to mysql with SSL

Would like to see a way to enable SSL for mysql. There is an option in PowerDNS to allow this
gmysql-ssl=yes

When adding PDNS_gmysql_ssl=yes as a environment filter, the docker-entry script will not proceed as it's attempting to access mysql without a '--ssl' option then sitting in a loop waiting for a connection.

thread died with error: virtual void GSQLBackend [...] Unknown column 'd.options' in 'field list'

Hi, I updated the image today and also updated the mariadb version, basically adjusted it to your docker-compose.yml file. Unfortunately the master pdns container runs into an error:

Exiting because communicator thread died with error: virtual void GSQLBackend::getUpdatedMasters(std::vector<DomainInfo>&, std::unordered_set<DNSName>&, CatalogHashMap&) unable to retrieve list of master domains: Could not prepare statement: select d.id, d.name, d.type, d.notified_serial,d.options, d.catalog,r.content from records r join domains d on r.domain_id=d.id and r.name=d.name where r.type='SOA' and r.disabled=0 and d.type in ('MASTER', 'PRODUCER'): Unknown column 'd.options' in 'field list'

I don't fully understand the issue. I can see that in the table domains, the master column is empty:

mysql> select * from domains;
+----+--------------------------+--------+------------+--------+-----------------+----------------+
| id | name                     | master | last_check | type   | notified_serial | account        |
+----+--------------------------+--------+------------+--------+-----------------+----------------+
|  6 |  domain.tld              |        |       NULL | MASTER |      2023011502 |      username  |
|  7 | ip.in-addr.arpa          |        |       NULL | MASTER |      2022101202 |                |
+----+--------------------------+--------+------------+--------+-----------------+----------------+
7 rows in set (0.00 sec)

But I don't know if that's intended or not.

Do you have any idea what the issue might be and be able to help me out?

PS: Thank you for your work on this repo and all of the other projects you run.

pdns-admin-uwsgi NameError: name 'pdns' is not defined

         Name                       Command                  State                                   Ports
---------------------------------------------------------------------------------------------------------------------------------------
dns_pdns-admin-uwsgi_1   /docker-entrypoint.sh /usr ...   Exit 1
dns_pdns-admin-web_1     /usr/sbin/nginx -g daemon off;   Up             0.0.0.0:8080->80/tcp
dns_pdns-master_1        /docker-entrypoint.sh /usr ...   Up             0.0.0.0:53->53/tcp, 0.0.0.0:53->53/udp, 0.0.0.0:8081->8081/tcp
dns_pdns-mysql-admin_1   docker-entrypoint.sh --def ...   Up (healthy)   0.0.0.0:3306->3306/tcp, 33060/tcp
pdns-admin-uwsgi_1  | Traceback (most recent call last):
pdns-admin-uwsgi_1  |   File "/usr/local/bin/flask", line 10, in <module>
pdns-admin-uwsgi_1  |     sys.exit(main())
pdns-admin-uwsgi_1  |   File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 894, in main
pdns-admin-uwsgi_1  |     cli.main(args=args, prog_name=name)
pdns-admin-uwsgi_1  |   File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 557, in main
pdns-admin-uwsgi_1  |     return super(FlaskGroup, self).main(*args, **kwargs)
pdns-admin-uwsgi_1  |   File "/usr/local/lib64/python3.7/site-packages/click/core.py", line 717, in main
pdns-admin-uwsgi_1  |     rv = self.invoke(ctx)
pdns-admin-uwsgi_1  |   File "/usr/local/lib64/python3.7/site-packages/click/core.py", line 1137, in invoke
pdns-admin-uwsgi_1  |     return _process_result(sub_ctx.command.invoke(sub_ctx))
pdns-admin-uwsgi_1  |   File "/usr/local/lib64/python3.7/site-packages/click/core.py", line 1137, in invoke
pdns-admin-uwsgi_1  |     return _process_result(sub_ctx.command.invoke(sub_ctx))
pdns-admin-uwsgi_1  |   File "/usr/local/lib64/python3.7/site-packages/click/core.py", line 956, in invoke
pdns-admin-uwsgi_1  |     return ctx.invoke(self.callback, **ctx.params)
pdns-admin-uwsgi_1  |   File "/usr/local/lib64/python3.7/site-packages/click/core.py", line 555, in invoke
pdns-admin-uwsgi_1  |     return callback(*args, **kwargs)
pdns-admin-uwsgi_1  |   File "/usr/local/lib64/python3.7/site-packages/click/decorators.py", line 17, in new_func
pdns-admin-uwsgi_1  |     return f(get_current_context(), *args, **kwargs)
pdns-admin-uwsgi_1  |   File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 411, in decorator
pdns-admin-uwsgi_1  |     with __ctx.ensure_object(ScriptInfo).load_app().app_context():
pdns-admin-uwsgi_1  |   File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 377, in load_app
pdns-admin-uwsgi_1  |     raise_if_not_found=False)
pdns-admin-uwsgi_1  |   File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 235, in locate_app
pdns-admin-uwsgi_1  |     __import__(module_name)
pdns-admin-uwsgi_1  |   File "/opt/powerdns-admin/app/__init__.py", line 24, in <module>
pdns-admin-uwsgi_1  |     app.config.from_object('config')
pdns-admin-uwsgi_1  |   File "/usr/local/lib/python3.7/site-packages/flask/config.py", line 170, in from_object
pdns-admin-uwsgi_1  |     obj = import_string(obj)
pdns-admin-uwsgi_1  |   File "/usr/local/lib/python3.7/site-packages/werkzeug/utils.py", line 546, in import_string
pdns-admin-uwsgi_1  |     __import__(import_name)
pdns-admin-uwsgi_1  |   File "/opt/powerdns-admin/config.py", line 7, in <module>
pdns-admin-uwsgi_1  |     SQLA_DB_HOST = pdns-mysql-admin
pdns-admin-uwsgi_1  | NameError: name 'pdns' is not defined

keeps getting this error NameError: name 'pdns' is not defined not sure what is happening
i see it connects to the database fine but then it exits with that error

here is my docker-compose file

version: '3.7'

services:
  pdns-mysql-admin:
    image: mysql
    hostname: pdns-mysql-admin
    ports:
      - '3306:3306'
    cap_add:
      - SYS_NICE
    networks:
      - backend
    environment:
      - MYSQL_ROOT_PASSWORD=PaSsWoRd123
      - MYSQL_DATABASE=powerdns
      - MYSQL_USER=powerdns
      - MYSQL_PASSWORD=PaSsWoRd123
    command: --default-authentication-plugin=mysql_native_password
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
      timeout: 10s
      retries: 5
    
  pdns-master:
    image: pschiffe/pdns-mysql
    hostname: pdns-master
    networks:
      - backend
    ports:
      - '53:53'
      - '53:53/udp'
      - '8081:8081'
    environment:
      - PDNS_master=yes
      - PDNS_api=yes
      - PDNS_api_key=secret
      - PDNS_webserver=yes
      - PDNS_webserver_address=0.0.0.0
      - PDNS_webserver_password=secret2
      - PDNS_version_string=anonymous
      - PDNS_default_ttl=1500
      - PDNS_soa_minimum_ttl=1200
      - PDNS_default_soa_name=ns1.example.com
      - PDNS_default_soa_mail=hostmaster.example.com
      - PDNS_allow_axfr_ips=0.0.0.0
      - PDNS_gmysql_password=PaSsWoRd123
      - PDNS_gmysql_user=powerdns
      - PDNS_gmysql_host=mysql
      - PDNS_gmysql_dbname=powerdns
    links:
      - pdns-mysql-admin:mysql
    depends_on:
      - pdns-mysql-admin

  pdns-admin-uwsgi:
    image: pschiffe/pdns-admin-uwsgi:ngoduykhanh
    hostname: pdns-admin-uwsgi
    networks:
      - backend
    environment:
      - PDNS_ADMIN_SQLA_DB_HOST=pdns-mysql-admin
      - PDNS_ADMIN_SQLA_DB_PORT=3306
      - PDNS_ADMIN_SQLA_DB_USER=powerdns
      - PDNS_ADMIN_SQLA_DB_PASSWORD=PaSsWoRd123
      - PDNS_ADMIN_SQLA_DB_NAME=powerdns
      - PDNS_API_URL="http://pdns:8081/"
      - PDNS_API_KEY="secret"
    links:
      - pdns-master:pdns
      - pdns-mysql-admin:mysql
    depends_on:
      - pdns-mysql-admin
      - pdns-master

  pdns-admin-web:
    image: pschiffe/pdns-admin-static:ngoduykhanh
    networks:
      - backend
    ports:
      - '8080:80'
    links:
      - pdns-admin-uwsgi:pdns-admin-uwsgi
    depends_on:
      - pdns-admin-uwsgi

networks:
  backend:
    name: backend

Login Auth

Is it possible to set in docker file as Env the options for any the Auth mechanism?
PDNS UI offers LDAP,AD, O-auth...
there are some variables such as following that you can set to connect your LDAP with PDNS. can we pass these parms as ENV?
PDNS_API_URL
PDNS_API_KEY
PDNS_VERSION
LOCAL_DB_ENABLED
SIGNUP_ENABLED
LDAP_ENABLED
LDAP_TYPE
LDAP_URI
LDAP_BASE_DN
LDAP_ADMIN_USERNAME
LDAP_ADMIN_PASSWORD
LDAP_FILTER_BASIC
LDAP_FILTER_USERNAME
LDAP_SG_ENABLED
LDAP_ADMIN_GROUP
LDAP_OPERATOR_GROUP
LDAP_USER_GROUP
LDAP_DOMAIN
GITHUB_OAUTH_ENABLED
GITHUB_OAUTH_KEY
GITHUB_OAUTH_SECRET
GITHUB_OAUTH_SCOPE
GITHUB_OAUTH_API_URL
GITHUB_OAUTH_TOKEN_URL
GITHUB_OAUTH_AUTHORIZE_URL
GOOGLE_OAUTH_ENABLED
GOOGLE_OAUTH_CLIENT_ID
GOOGLE_OAUTH_CLIENT_SECRET
GOOGLE_TOKEN_URL
GOOGLE_OAUTH_SCOPE
GOOGLE_AUTHORIZE_URL
GOOGLE_BASE_URL
OIDC_OAUTH_ENABLED
OIDC_OAUTH_KEY
OIDC_OAUTH_SECRET
OIDC_OAUTH_SCOPE
OIDC_OAUTH_API_URL
OIDC_OAUTH_TOKEN_URL

Outdated containers on hub.docker.com

Would be great to have new builds pushed to docker hub. Even better, it would be nice to have a pipeline or an automated build process that can push to docker hub whenever a new PowerDNS version is released.

Update to 4.6 breaks `envtpl` on startup

Hello @pschiffe!

I just pulled the new images and found that my PowerDNS instance is unable to start. Here's the log I get:

Traceback (most recent call last):
  File "/usr/local/bin/envtpl", line 33, in <module>
    sys.exit(load_entry_point('envtpl==0.6.0', 'console_scripts', 'envtpl')())
  File "/usr/local/bin/envtpl", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 162, in load
    module = import_module(match.group('module'))
  File "/usr/lib64/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/local/lib/python3.10/site-packages/envtpl.py", line 150, in <module>
    @jinja2.contextfunction
AttributeError: module 'jinja2' has no attribute 'contextfunction'
pdns_powerdns_1 exited with code 1

This happens on both Fedora-based and Alpine-based images, the only difference being the Python version (3.10 on Fedora and 3.9 on Alpine).

uname -n no longer returns FQDN on Docker 19, breaking supermaster functionality

This line expects uname -n to return a FQDN:

MYSQL_INSERT_SUPERMASTERS="${MYSQL_INSERT_SUPERMASTERS} INSERT INTO supermasters VALUES('${i}', '$(uname -n)', 'admin');"

All these containers have --hostname nsX.example.com

on a Debian 10 host, using Docker's repository:

# docker -v
Docker version 19.03.2, build 6a30dfc
# docker-compose exec master uname -n
ns1

On a Debian 10 host, using Debian's package docker.io:

# docker -v
Docker version 18.09.1, build 4c52b90
# docker-compose exec slave uname -n
ns2.example.com

on a Ubuntu 18.04 host, using Docker's repository:

# docker -v
Docker version 19.03.2, build 6a30dfc
# docker-compose exec slave uname -n
ns3

Meanwhile, on all of these containers, cat /etc/hosts returns the correct hostname on the 172.xxx.xxx.xxx line

This could be fixed by installing hostname package and replacing uname -n with hostname -f (same as hostname --fqdn but works on Alpine too)

Exception thrown in form of stacktrace

Hi there,

I am trying to use the docker images provided here in combination with a docker-compose.yml file. When I am running the stack with a mariadb I am getting a stack trace error, which I don't really understand. Could you have a look at my docker-compose.yml file and try to replicate the issue.

I am not sure if the issue might be related to the database not being ready once the powerdns process is started.

Thanks for your help.

docker-compose.yml

---

version: "3"

services:
  database:
    image: mariadb
    environment:
      - MYSQL_DATABASE=pdns
      - MYSQL_ROOT_PASSWORD=pdns
      - MYSQL_USER=pdns
      - MYSQL_PASSWORD=pdns

  pdns:
    image: pschiffe/pdns-mysql:4.6
    depends_on:
      - database
    environment:
      - PDNS_master=yes
      - PDNS_api=yes
      - PDNS_api_key=secret
      - PDNS_webserver=yes
      - PDNS_gmysql_host=database
      - PDNS_gmysql_dbname=pdns
      - PDNS_gmysql_user=pdns
      - PDNS_gmysql_password=pdns
      - PDNS_gmysql_port=3306
    ports:
      - "50020:8081"

Console output

$ docker-compose up
Creating network "powerdns_default" with the default driver
Creating powerdns_database_1 ... done
Creating powerdns_pdns_1     ... done
Attaching to powerdns_database_1, powerdns_pdns_1
database_1  | 2022-04-13 09:07:05+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.7.3+maria~focal started.
database_1  | 2022-04-13 09:07:05+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
database_1  | 2022-04-13 09:07:05+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.7.3+maria~focal started.
database_1  | 2022-04-13 09:07:06+00:00 [Note] [Entrypoint]: Initializing database files
database_1  | 2022-04-13  9:07:06 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
pdns_1      | ERROR 2002 (HY000): Can't connect to MySQL server on 'database' (115)
pdns_1      | MySQL is unavailable - sleeping
database_1  |
database_1  |
database_1  | PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
database_1  | To do so, start the server, then issue the following command:
database_1  |
database_1  | '/usr/bin/mysql_secure_installation'
database_1  |

database_1  | which will also give you the option of removing the test
database_1  | databases and anonymous user created by default.  This is
database_1  | strongly recommended for production servers.
database_1  |
database_1  | See the MariaDB Knowledgebase at https://mariadb.com/kb
database_1  |
database_1  | Please report any problems at https://mariadb.org/jira
database_1  |
database_1  | The latest information about MariaDB is available at https://mariadb.org/.
database_1  |
database_1  | Consider joining MariaDB's strong and vibrant community:
database_1  | https://mariadb.org/get-involved/
database_1  |
database_1  | 2022-04-13 09:07:09+00:00 [Note] [Entrypoint]: Database files initialized
database_1  | 2022-04-13 09:07:09+00:00 [Note] [Entrypoint]: Starting temporary server
database_1  | 2022-04-13 09:07:09+00:00 [Note] [Entrypoint]: Waiting for server startup
database_1  | 2022-04-13  9:07:09 0 [Note] mariadbd (server 10.7.3-MariaDB-1:10.7.3+maria~focal) starting as process 100 ...
database_1  | 2022-04-13  9:07:09 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
database_1  | 2022-04-13  9:07:09 0 [Note] InnoDB: Number of transaction pools: 1
database_1  | 2022-04-13  9:07:09 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
database_1  | 2022-04-13  9:07:09 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
database_1  | 2022-04-13  9:07:09 0 [Note] InnoDB: Using Linux native AIO
database_1  | 2022-04-13  9:07:09 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
database_1  | 2022-04-13  9:07:09 0 [Note] InnoDB: Completed initialization of buffer pool
database_1  | 2022-04-13  9:07:09 0 [Note] InnoDB: 128 rollback segments are active.
database_1  | 2022-04-13  9:07:09 0 [Note] InnoDB: Creating shared tablespace for temporary tables
database_1  | 2022-04-13  9:07:09 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
database_1  | 2022-04-13  9:07:09 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
database_1  | 2022-04-13  9:07:09 0 [Note] InnoDB: 10.7.3 started; log sequence number 42173; transaction id 14
database_1  | 2022-04-13  9:07:09 0 [Note] Plugin 'FEEDBACK' is disabled.
database_1  | 2022-04-13  9:07:09 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
database_1  | 2022-04-13  9:07:09 0 [Warning] 'user' entry 'root@1fcbbdf060a5' ignored in --skip-name-resolve mode.
database_1  | 2022-04-13  9:07:09 0 [Warning] 'proxies_priv' entry '@% root@1fcbbdf060a5' ignored in --skip-name-resolve mode.
database_1  | 2022-04-13  9:07:09 0 [Note] mariadbd: ready for connections.
database_1  | Version: '10.7.3-MariaDB-1:10.7.3+maria~focal'  socket: '/run/mysqld/mysqld.sock'  port: 0  mariadb.org binary distribution
pdns_1      | ERROR 2002 (HY000): Can't connect to MySQL server on 'database' (115)
pdns_1      | MySQL is unavailable - sleeping
database_1  | 2022-04-13 09:07:10+00:00 [Note] [Entrypoint]: Temporary server started.
database_1  | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
database_1  | Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
database_1  | Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
database_1  | 2022-04-13 09:07:12+00:00 [Note] [Entrypoint]: Securing system users (equivalent to running mysql_secure_installation)
database_1  | 2022-04-13 09:07:12+00:00 [Note] [Entrypoint]: Creating database pdns
database_1  | 2022-04-13 09:07:12+00:00 [Note] [Entrypoint]: Creating user pdns
database_1  | 2022-04-13 09:07:12+00:00 [Note] [Entrypoint]: Giving user pdns access to schema pdns
database_1  |
database_1  | 2022-04-13 09:07:12+00:00 [Note] [Entrypoint]: Stopping temporary server
database_1  | 2022-04-13  9:07:12 0 [Note] mariadbd (initiated by: root[root] @ localhost []): Normal shutdown
database_1  | 2022-04-13  9:07:12 0 [Note] InnoDB: FTS optimize thread exiting.
database_1  | 2022-04-13  9:07:12 0 [Note] InnoDB: Starting shutdown...
database_1  | 2022-04-13  9:07:12 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
database_1  | 2022-04-13  9:07:12 0 [Note] InnoDB: Buffer pool(s) dump completed at 220413  9:07:12
database_1  | 2022-04-13  9:07:12 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
database_1  | 2022-04-13  9:07:12 0 [Note] InnoDB: Shutdown completed; log sequence number 42185; transaction id 15
database_1  | 2022-04-13  9:07:12 0 [Note] mariadbd: Shutdown complete
database_1  |
pdns_1      | ERROR 2002 (HY000): Can't connect to MySQL server on 'database' (115)
pdns_1      | MySQL is unavailable - sleeping
database_1  | 2022-04-13 09:07:13+00:00 [Note] [Entrypoint]: Temporary server stopped
database_1  |
database_1  | 2022-04-13 09:07:13+00:00 [Note] [Entrypoint]: MariaDB init process done. Ready for start up.
database_1  |
database_1  | 2022-04-13  9:07:13 0 [Note] mariadbd (server 10.7.3-MariaDB-1:10.7.3+maria~focal) starting as process 1 ...
database_1  | 2022-04-13  9:07:13 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
database_1  | 2022-04-13  9:07:13 0 [Note] InnoDB: Number of transaction pools: 1
database_1  | 2022-04-13  9:07:13 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
database_1  | 2022-04-13  9:07:13 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
database_1  | 2022-04-13  9:07:13 0 [Note] InnoDB: Using Linux native AIO
database_1  | 2022-04-13  9:07:13 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
database_1  | 2022-04-13  9:07:13 0 [Note] InnoDB: Completed initialization of buffer pool
database_1  | 2022-04-13  9:07:13 0 [Note] InnoDB: 128 rollback segments are active.
database_1  | 2022-04-13  9:07:13 0 [Note] InnoDB: Creating shared tablespace for temporary tables
database_1  | 2022-04-13  9:07:13 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
database_1  | 2022-04-13  9:07:13 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
database_1  | 2022-04-13  9:07:13 0 [Note] InnoDB: 10.7.3 started; log sequence number 42185; transaction id 14
database_1  | 2022-04-13  9:07:13 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
database_1  | 2022-04-13  9:07:13 0 [Note] Plugin 'FEEDBACK' is disabled.
database_1  | 2022-04-13  9:07:13 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
database_1  | 2022-04-13  9:07:13 0 [Note] Server socket created on IP: '0.0.0.0'.
database_1  | 2022-04-13  9:07:13 0 [Note] Server socket created on IP: '::'.
database_1  | 2022-04-13  9:07:13 0 [Note] InnoDB: Buffer pool(s) load completed at 220413  9:07:13
database_1  | 2022-04-13  9:07:13 0 [Note] mariadbd: ready for connections.
database_1  | Version: '10.7.3-MariaDB-1:10.7.3+maria~focal'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
pdns_1      | Apr 13 09:07:16 Created local state directory '/var/run/pdns/'
pdns_1      | Apr 13 09:07:16 Listening on controlsocket in '/var/run/pdns/pdns.controlsocket'
pdns_1      | terminate called after throwing an instance of 'std::system_error'
pdns_1      |   what():  Operation not permitted
pdns_1      | Apr 13 09:07:16 Got a signal 6, attempting to print trace:
pdns_1      | Apr 13 09:07:16 /usr/sbin/pdns_server(+0x228a93) [0x555febf66a93]
pdns_1      | Apr 13 09:07:16 /lib64/libc.so.6(+0x42750) [0x7fcf606bf750]
pdns_1      | Apr 13 09:07:16 /lib64/libc.so.6(+0x8f88c) [0x7fcf6070c88c]
pdns_1      | Apr 13 09:07:16 /lib64/libc.so.6(raise+0x16) [0x7fcf606bf6a6]
pdns_1      | Apr 13 09:07:16 /lib64/libc.so.6(abort+0xd3) [0x7fcf606a97d3]
pdns_1      | Apr 13 09:07:16 /lib64/libstdc++.so.6(+0xa1a06) [0x7fcf60a1fa06]
pdns_1      | Apr 13 09:07:16 /lib64/libstdc++.so.6(+0xad0bc) [0x7fcf60a2b0bc]
pdns_1      | Apr 13 09:07:16 /lib64/libstdc++.so.6(+0xad127) [0x7fcf60a2b127]
pdns_1      | Apr 13 09:07:16 /lib64/libstdc++.so.6(+0xad3c9) [0x7fcf60a2b3c9]
pdns_1      | Apr 13 09:07:16 /lib64/libstdc++.so.6(_ZSt20__throw_system_errori+0x88) [0x7fcf60a227d5]
pdns_1      | Apr 13 09:07:16 /lib64/libstdc++.so.6(+0xd96ad) [0x7fcf60a576ad]
pdns_1      | Apr 13 09:07:16 /usr/sbin/pdns_server(_ZN11DynListener2goEv+0x64) [0x555febeded04]
pdns_1      | Apr 13 09:07:16 /usr/sbin/pdns_server(main+0xdb2) [0x555febe41ca2]
pdns_1      | Apr 13 09:07:16 /lib64/libc.so.6(+0x2d560) [0x7fcf606aa560]
pdns_1      | Apr 13 09:07:16 /lib64/libc.so.6(__libc_start_main+0x7c) [0x7fcf606aa60c]
pdns_1      | Apr 13 09:07:16 /usr/sbin/pdns_server(_start+0x25) [0x555febe48275]
pdns_1      | Apr 13 09:07:16 Got a signal 11, attempting to print trace:
pdns_1      | Apr 13 09:07:16 /usr/sbin/pdns_server(+0x228a93) [0x555febf66a93]
pdns_1      | Apr 13 09:07:16 /lib64/libc.so.6(+0x42750) [0x7fcf606bf750]
pdns_1      | Apr 13 09:07:16 /lib64/libc.so.6(abort+0x178) [0x7fcf606a9878]
pdns_1      | Apr 13 09:07:16 /usr/sbin/pdns_server(+0x228ef1) [0x555febf66ef1]
pdns_1      | Apr 13 09:07:16 /lib64/libc.so.6(+0x42750) [0x7fcf606bf750]
pdns_1      | Apr 13 09:07:16 /lib64/libc.so.6(+0x8f88c) [0x7fcf6070c88c]
pdns_1      | Apr 13 09:07:16 /lib64/libc.so.6(raise+0x16) [0x7fcf606bf6a6]
pdns_1      | Apr 13 09:07:16 /lib64/libc.so.6(abort+0xd3) [0x7fcf606a97d3]
pdns_1      | Apr 13 09:07:16 /lib64/libstdc++.so.6(+0xa1a06) [0x7fcf60a1fa06]
pdns_1      | Apr 13 09:07:16 /lib64/libstdc++.so.6(+0xad0bc) [0x7fcf60a2b0bc]
pdns_1      | Apr 13 09:07:16 /lib64/libstdc++.so.6(+0xad127) [0x7fcf60a2b127]
pdns_1      | Apr 13 09:07:16 /lib64/libstdc++.so.6(+0xad3c9) [0x7fcf60a2b3c9]
pdns_1      | Apr 13 09:07:16 /lib64/libstdc++.so.6(_ZSt20__throw_system_errori+0x88) [0x7fcf60a227d5]
pdns_1      | Apr 13 09:07:16 /lib64/libstdc++.so.6(+0xd96ad) [0x7fcf60a576ad]
pdns_1      | Apr 13 09:07:16 /usr/sbin/pdns_server(_ZN11DynListener2goEv+0x64) [0x555febeded04]
pdns_1      | Apr 13 09:07:16 /usr/sbin/pdns_server(main+0xdb2) [0x555febe41ca2]
pdns_1      | Apr 13 09:07:16 /lib64/libc.so.6(+0x2d560) [0x7fcf606aa560]
pdns_1      | Apr 13 09:07:16 /lib64/libc.so.6(__libc_start_main+0x7c) [0x7fcf606aa60c]
pdns_1      | Apr 13 09:07:16 /usr/sbin/pdns_server(_start+0x25) [0x555febe48275]
powerdns_pdns_1 exited with code 127

Quotes around environment variables?

I'm not sure why you need quotes around environment variables, but it feels like it might be an excellent way to exploit this code base with an injection attack.

Its also VERY confusing having to put quotes around quotes... can this be fixed?

Trying to kubernetize your work

Hi,

You've done a really nice work. Thanks for that.

I'm trying to use your work to create an Helm chart to migrate PowerDNS to Kubernetes. It's almost completed, but the uwsgi image crashes after a certain amount of time. The pod logs shows:

Traceback (most recent call last):
File "/usr/local/bin/flask", line 10, in
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 894, in main
cli.main(args=args, prog_name=name)
File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 557, in main
return super(FlaskGroup, self).main(*args, **kwargs)
File "/usr/local/lib64/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib64/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib64/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib64/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib64/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib64/python3.7/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 411, in decorator
with __ctx.ensure_object(ScriptInfo).load_app().app_context():
File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 377, in load_app
raise_if_not_found=False)
File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 235, in locate_app
import(module_name)
File "/opt/powerdns-admin/app/init.py", line 24, in
app.config.from_object('config')
File "/usr/local/lib/python3.7/site-packages/flask/config.py", line 170, in from_object
obj = import_string(obj)
File "/usr/local/lib/python3.7/site-packages/werkzeug/utils.py", line 547, in import_string
import(import_name)
File "/opt/powerdns-admin/config.py", line 12
UWSGI_PORT = tcp://10.43.148.140:9494
^
SyntaxError: invalid syntax

I can't actually find what it's trying to do. The 10.43.148.140 is actually the service IP that the pods's is given at start time, and I just can't find any reference of it into the files... until the pod crashes.

Any clue?

Supermaster not work (Unable to find backend)

Hi, can you help me?

Supermaster not working:

Mar 06 08:46:41 Received NOTIFY for test.local from xxx.xxx.xxx.xxx:19711 for which we are not authoritative, trying supermaster
Mar 06 08:46:41 Unable to find backend willing to host test.local for potential supermaster 94.130.189.144. Remote nameservers:
Mar 06 08:46:41 ns2.test.local
Mar 06 08:46:41 ns1.test.local

ns2	A	Active	3600	yyy.yyy.yyy.yyy			
ns1	A	Active	3600	xxx.xxx.xxx.xxx			
@	NS	Active	3600	ns2.test.local.			
@	NS	Active	3600	ns1.test.local.			
@	SOA	Active	1800	ns1.test.local. hostmaster.test.local. 2020030206 10800 3600 604800 3600

Thank you!
David

pdns-recursor api parameter

Hello

At starting pdns-recursor got next error:

Jun 10 03:27:56 Exception: Trying to set unknown parameter 'api'

How to fix it ?

Versioning of Releases

Hi,
In dockerfile it do curl (this line) and get the latest from pdns master branch, as user you may want to install specific branch, or better to say you already installed with current format, your pdns version maybe 4.3.x and due to some issues after a while you try to redeploy the docker file or ansible playbook, you will land to new pdns version something like 4.5.0.
The only thing currently is versioned is phpmyadmin and MariaDB

Suggestion:

  1. either curl command in dockerfile done from specific tags from pdns which corresponds to a release/version
  2. dockers in docker hub be taged for each pdns version

Problem with Current situation:

  1. unwanted update/upgrade
  2. No control for users to stay with specific version
  3. Danger that sometimes in master wouldn't be stable version/release

I would be happy to elaborate and kinda help to make it possible.

Docker Hub verions

Hello,

I tried to run your ansible-playbook.yml to create a docker container, but it failed with an error about unknown c_state (16)

I have a MySQL cluster setup and would like to run your docker-pdns to connect to it as well.

Is there a docker image available on Docker Hub (https://hub.docker.com/)

Maybe I can pull it from there?

Thanks,
Lonnie

Pdns 4.5

Hi Peter,
are you planning to release the pdns 4.5 docker image?
Can I help somehow?

Regards,
Riccardo

uWSGI not working PORT format incorrect error

Hi,

I tried to run the admin but the backend is giving me error and front end is showing nginx temporary unavailable page.

uWSGI error:


Traceback (most recent call last):
  File "/usr/local/bin/flask", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 966, in main
    cli.main(prog_name="python -m flask" if as_module else None)
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 586, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 425, in decorator
    with __ctx.ensure_object(ScriptInfo).load_app().app_context():
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 388, in load_app
    app = locate_app(self, import_name, name)
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 257, in locate_app
    return find_best_app(script_info, module)
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 83, in find_best_app
    app = call_factory(script_info, app_factory)
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 119, in call_factory
    return app_factory()
  File "/opt/powerdns-admin/powerdnsadmin/__init__.py", line 63, in create_app
    app.config.from_object('powerdnsadmin.default_config')
  File "/usr/local/lib/python3.8/site-packages/flask/config.py", line 174, in from_object
    obj = import_string(obj)
  File "/usr/local/lib/python3.8/site-packages/werkzeug/utils.py", line 568, in import_string
    __import__(import_name)
  File "/opt/powerdns-admin/powerdnsadmin/default_config.py", line 12
    PORT = tcp://10.107.79.80:11153
              ^
SyntaxError: invalid syntax

pdns-admin-uwsgi doesn`t start

Hello
I try to start pdns-admin-uwsgi

docker run -d --name pdns-admin-uwsgi --link mariadb:mysql --link pdns-master:pdns pschiffe/pdns-admin-uwsgi:ngoduykhanh

but have error
in logs

File "/usr/local/lib/python3.7/site-packages/alembic/script/base.py", line 489, in run_env util.load_python_file(self.dir, "env.py") File "/usr/local/lib/python3.7/site-packages/alembic/util/pyfiles.py", line 98, in load_python_file module = load_module_py(module_id, path) File "/usr/local/lib/python3.7/site-packages/alembic/util/compat.py", line 184, in load_module_py spec.loader.exec_module(module) File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "migrations/env.py", line 88, in <module> run_migrations_online() File "migrations/env.py", line 81, in run_migrations_online context.run_migrations() File "<string>", line 8, in run_migrations File "/usr/local/lib/python3.7/site-packages/alembic/runtime/environment.py", line 846, in run_migrations self.get_context().run_migrations(**kw) File "/usr/local/lib/python3.7/site-packages/alembic/runtime/migration.py", line 520, in run_migrations step.migration_fn(**kw) File "/opt/powerdns-admin/migrations/versions/856bb94b7040_add_comment_column_in_domain_template_.py", line 22, in upgrade sa.Column('comment', sa.Text(), nullable=True)) File "<string>", line 8, in add_column File "<string>", line 3, in add_column File "/usr/local/lib/python3.7/site-packages/alembic/operations/ops.py", line 1929, in add_column return operations.invoke(op) File "/usr/local/lib/python3.7/site-packages/alembic/operations/base.py", line 374, in invoke return fn(self, operation) File "/usr/local/lib/python3.7/site-packages/alembic/operations/toimpl.py", line 132, in add_column operations.impl.add_column(table_name, column, schema=schema, **kw) File "/usr/local/lib/python3.7/site-packages/alembic/ddl/impl.py", line 237, in add_column self._exec(base.AddColumn(table_name, column, schema=schema)) File "/usr/local/lib/python3.7/site-packages/alembic/ddl/impl.py", line 140, in _exec return conn.execute(construct, *multiparams, **params) File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 982, in execute return meth(self, multiparams, params) File "/usr/local/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py", line 72, in _execute_on_connection return connection._execute_ddl(self, multiparams, params) File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1044, in _execute_ddl compiled, File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1250, in _execute_context e, statement, parameters, cursor, context File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1476, in _handle_dbapi_exception util.raise_from_cause(sqlalchemy_exception, exc_info) File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 398, in raise_from_cause reraise(type(exception), exception, tb=exc_tb, cause=cause) File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 152, in reraise raise value.with_traceback(tb) File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1246, in _execute_context cursor, statement, parameters, context File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 581, in do_execute cursor.execute(statement, parameters) File "/usr/lib64/python3.7/site-packages/MySQLdb/cursors.py", line 255, in execute self.errorhandler(self, exc, value) File "/usr/lib64/python3.7/site-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler raise errorvalue File "/usr/lib64/python3.7/site-packages/MySQLdb/cursors.py", line 252, in execute res = self._query(query) File "/usr/lib64/python3.7/site-packages/MySQLdb/cursors.py", line 378, in _query db.query(q) File "/usr/lib64/python3.7/site-packages/MySQLdb/connections.py", line 280, in query _mysql.connection.query(self, query) sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1060, "Duplicate column name 'comment'") [SQL: ALTER TABLE domain_template_record ADD COLUMN comment TEXT] (Background on this error at: http://sqlalche.me/e/e3q8)
Can you help me? thanks

Interested in joined effort + armv32/armv64 builds

Great work here already. I started my own work first at https://github.com/eugenmayer/docker-powerdns due to the mass of really low quality docker images which i did not consider to contribute to since the distance is just to far.

You have build a really nice solutions though and i would love to contribute, if you are interested.

a) arm based builds ( arm32v6/7 for rpi1/2 and arm64v8 for pi3/bananapir and all others )
I have done this in my repo already and would just migrate those solutions to your repo

b) I got into troubles building https://github.com/ngoduykhanh/PowerDNS-Admin.git specificly using there specs

  • a very long build time ( 5 minutes ) due to all the python contribs fetched.. i did not properly use virtuenv, maybe thats the key here
  • after starting the image ( its a combined static/backend) the image takes about 3 minutes to do something ( generate assets ) and then the GUI was responding. I am not sure this is because i bundled with sqlite and it actually has issues with that or its again something which went wrong because i did not user flask/virtualenv

I would like to contribute a) and solve b) together, if those exists with your images. Splitting static and backend is a really nice work already, i hope we can stick to that, also incorporate #12 or stick with your repo of choice if that is actually the reason b) works.

I would split all those things in different issues if you are actually interested in me creating those PRs - let me know

And thanks for your work!

Forward zones from recursor doesnt work

I have a docker-compose file to run the authoritative dns server together with recursor configured like this:

version: '3'

services:
db:
image: mariadb:10-jessie
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
- MYSQL_DATABASE=powerdnsadmin
- MYSQL_USER=lradmin
- MYSQL_PASSWORD=lrpdns
ports:
- 3306:3306
restart: always
volumes:
- /pdns-mysql:/var/lib/mysql
pdns-recursor:
image: pschiffe/pdns-recursor:alpine
ports:
- '53:53'
- '53:53/udp'
environment:
- PDNS_api_key=secret
- PDNS_webserver=yes
- PDNS_webserver_address=0.0.0.0
- PDNS_webserver_password=secret2
- PDNS_forward-zones=lrdevelop.com.=192.168.1.37:54
pdns:
image: pschiffe/pdns-mysql:alpine
hostname: pdns
domainname: lrdevelop.com
restart: always
depends_on:
- db
ports:
- "54:53"
- "54:53/udp"
- "8081:8081"
environment:
- PDNS_gmysql_host=db
- PDNS_gmysql_port=3306
- PDNS_gmysql_user=lradmin
- PDNS_gmysql_dbname=powerdnsadmin
- PDNS_gmysql_password=lrpdns
- PDNS_master=yes
- PDNS_api=yes
- PDNS_api_key=secret
- PDNSCONF_API_KEY=secret
- PDNS_webserver=yes
- PDNS_webserver-allow-from=127.0.0.1,10.0.0.0/8,172.0.0.0/8,192.0.0.0/24,192.168.1.0/24
- PDNS_webserver_address=0.0.0.0
- PDNS_webserver_password=secret2
- PDNS_version_string=anonymous
- PDNS_default_ttl=1500
- PDNS_allow_notify_from=0.0.0.0
- PDNS_allow_axfr_ips=127.0.0.1

web_app:
image: powerdnsadmin/pda-legacy:latest
container_name: powerdns_admin
ports:
- "8080:80"
depends_on:
- db
restart: always
logging:
driver: json-file
options:
max-size: 50m
environment:
- SQLALCHEMY_DATABASE_URI=mysql://lradmin:lrpdns@db/powerdnsadmin
- GUNICORN_TIMEOUT=60
- GUNICORN_WORKERS=2
- GUNICORN_LOGLEVEL=DEBUG
- OFFLINE_MODE=False

For some reason the recursor is not forwarding request to the authoritative dns server to resolve the custom domains. Can someone help?

Unable to redirect /etc/pdns/pdns.conf

I'm tryiing to redirect the whole pdns.conf file in psitrax/powerdns.

Here is my config:

docker create --name=pdns \
--user=root \
--log-driver syslog --log-opt tag=pdns_syslog --log-opt syslog-address=udp://10.0.0.5 \
--restart=always \
--network=infrastructure_network \
--network-alias=pdns \
-p 53:53 \
-p 53:53/udp \
-e PGID=1001 -e PUID=1001 \
-e TZ=America/Phoenix \
-v /local_configs/pdns/pdns.conf:/etc/pdns/pdns.conf \
psitrax/powerdns:latest \
--cache-ttl=120 \
--allow-axfr-ips=127.0.0.1,10.0.1.10

which results in the following errors:

sed: can't move '/etc/pdns/pdns.confbgdfep' to '/etc/pdns/pdns.conf': resource busy
sed: can't move '/etc/pdns/pdns.confglejgh' to '/etc/pdns/pdns.conf': resource busy
sed: can't move '/etc/pdns/pdns.conficilgg' to '/etc/pdns/pdns.conf': resource busy
sed: can't move '/etc/pdns/pdns.confbfphgk' to '/etc/pdns/pdns.conf': resource busy
sed: can't move '/etc/pdns/pdns.conflcbiha' to '/etc/pdns/pdns.conf': resource busy
sed: can't move '/etc/pdns/pdns.confamidpk' to '/etc/pdns/pdns.conf': resource busy
sed: can't move '/etc/pdns/pdns.confpnhbcn' to '/etc/pdns/pdns.conf': resource busy
sed: can't move '/etc/pdns/pdns.confcbenoh' to '/etc/pdns/pdns.conf': resource busy

I'm trying to follow your guide, which says "Want to use own config files? Mount a Volume to /etc/pdns/conf.d or simply overwrite /etc/pdns/pdns.conf" Am I missing a step??

did not find NS for xxxx

Hi,
I am using the ansible playbook for creating powerdns stack. after ansible-script is successfully done, the UI is crashing and I need to delete DBs from database and re-run the playbook and it works.
NOW the big problem is with Master/slave replication is not working.

Changes I did on ansible-script:

  1. expose on pdns-master the port 53 and API
    published_ports:
    - '10.29.33.33:8081:8081'
    - '10.29.33.33:53:53'
    - '10.29.33.33:53:53/udp'
  2. Add env
    PDNS_also_notify: '{{ pdns_slave_ip }}'

content of /etc/hosts
172.5.0.20 ns1.test.loc
172.5.0.21 ns2.test.loc

on Slave I get this error:
Received NOTIFY for mydomain.loc from 172.5.0.20:13606 for which we are not authoritative, trying supermaster
While checking for supermaster, did not find NS for mydomain.loc at: 172.5.0.20

On master it looks fine:
Queued also-notification of domain 'mydomain.loc' to 172.5.0.21:53
Removed from notification list: 'mydomain.loc' to 172.5.0.21:53 (was acknowledged)

Note: that DNS resolution is working only issue is replication.
Slave database is Domain and Record table is empty.
Is there anything that I am missing. DNS world is new for me, any help would be much appreciated .

unbound MYSQL_ENV_MYSQL_ROOT_PASSWORD variable

Hello,

I'm trying to spawn a powerdns dock using your image anad when the dock starts, it gives me:

pdns_1  | /docker-cmd.sh: line 10: MYSQL_ENV_MYSQL_ROOT_PASSWORD: unbound variable
powerdns_pdns_1 exited with code 1

I'm using mariadb:latest dock and th db dock is spawn like that:
version: "2"

services:
  db:
    image: mariadb:latest
    hostname: pdns-db
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./data/pdns-db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=myroot
      - MYSQL_DATABASE=pdns
      - MYSQL_USER=pdns
      - MYSQL_PASSWORD=mypdns
  pdns:
    image: pschiffe/pdns-mysql
    hostname: ns1
    domainname: domain.lan
    depends_on:
      - db
    links:
      - db:mysql
    ports:
      - 53:53
      - 53:53/udp
    volumes:
      - /etc/localtime:/etc/localtime:ro
    environment:
      - PDNS_master=yes
      - PDNS_api=yes
      - PDNS_webserver=yes
      - PDNS_webserver_address=0.0.0.0
      - PDNS_webserver_password=secret2
      - PDNS_version_string=anonymous
      - PDNS_default_ttl=120
      - PDNS_soa_minimum_ttl=600
      - PDNS_default_soa_name=ns1.domain.lan
      - [email protected]
      - PDNS_allow_axfr_ips=127.0.0.1

Any idea ? thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.