Configuration files and docker compose file for installation of Power DNS, with NSedit as frontend and MariaDB as backend
Requirements:
- Ubuntu 16.04 / Debian
- Docker
- Docker Compose
- Sudo access
This setup installs following services:
- PowerDNS authoritative server: Version 4.1.4
- MariaDB backend for PowerDNS: Version 10.2
File Descriptions:
docker-compose.yml
: Contains service definitions of all docker containerspdns.conf
: Configuration file for PowerDNS serverpdns_schema.sql
: SQL schema for PowerDNS required at installationexample_config
: Example configuration files from a single host setup (All service on one host)
These services can be installed on a single host but it is recommended to install them on separate hosts
Steps to Setup PowerDNS with MariaDB backend and NSedit as frontend:
-
Install Docker:
sudo curl -sSL https://get.docker.io | bash
-
Install Docker Compose: https://docs.docker.com/compose/install/#install-compose
sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s
-
uname -m` -o /usr/local/bin/docker-composesudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
-
Clone the repository:
git clone https://github.com/sahilkalra1991/docker_pdns.git
cd docker_pdns
-
Configure and Install MariaDB: https://hub.docker.com/_/mariadb/
- Configure via Environemnt variables in
docker-compose.yml
:MYSQL_ROOT_PASSWORD
: root user password for MariadbMYSQL_DATABASE
: Empty database to be createdMYSQL_USER
: New User to create with MYSQL_DATABASE accessMYSQL_PASSWORD
: New User's password- Other variables: https://hub.docker.com/_/mariadb/
- Create data volume:
docker volume create --name=mariadb-data
- Start service:
docker-compose up -d mariadb
- Configure via Environemnt variables in
-
Configure and Install PowerDNS: https://hub.docker.com/r/psitrax/powerdns/
- Configure via Configuration file
pdns.conf
pdns.conf
will be overwritten to/etc/pdns/pdns.conf
inside the container.- Required: Provide All settings marked with
<TODO>
i.e. search for TODO inpdns.conf
and provide required values e.g. api_key, allow-axfr-ips, allow-notify-from, gmysql-host etc - Optional: Other settings in the file. Change as per requirement
- Create PowerDNS schema via
pdns_schema.sql
:mysql -h <host_ip> -u pdns -p pdns < pdns_schema.sql
- Start service:
docker-compose up -d pdns-server
- Configure via Configuration file
Check Logs for respective services:
- Use command:
docker-compose logs -f <service_name>
e.g.docker-compose logs -f pdns-server
Other docker-compose commands:
- Check status of services:
docker-compose ps
- Stop service(s)
docker-compose stop [service_name]
- Remove container(s)
docker-compose rm [service_name]
- Logs for a service
docker-compose logs [-f] service_name