Code Monkey home page Code Monkey logo

docker-pdns-server's Introduction

PowerDNS Authoritative Server - MySQL Enabled Docker Image

The PowerDNS Auth Server is a powerful, authoritative DNS server with several exciting features. A full description can be found on the project website.

Credits

This image was heavily based on the great work of Peter Schiffer.

The reason for creating another version of the image, was:

  • To use the upstream packages from the PowerDNS Repositories.
  • To use a base image with a longer lifecycle.

The Image

Docker image with PowerDNS Authoritative Server.

Repositories

Usage

The image is MySQL enabled, so needs an external MySQL server to function.

Environment variables

ENV variables can be used for configuration:

(name=value)

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

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.

The database is automatically created if missing and initialized if tables are missing. This can be avoided by placing SKIP_DB_CREATE=true in the list of ENV variables.

The PowerDNS server is configurable via env vars. Every variable starting with PDNS_ will be inserted into the default /etc/powerdns/pdns.conf config file in the following way:

  • Prefix PDNS_ will be stripped
  • Every _ will be replaced with -

Example from above mysql config; PDNS_gmysql_host=mysql will become gmysql-host=mysql in /etc/powerdns/pdns.conf file. This way, you can configure PowerDNS server any way you need, within a docker run command.

There is also a SUPERMASTER_IPS env var supported, which can be used to configure supermasters for slave dns server. Docs. Multiple ip addresses separated by space should work.

Mounting configuration file

Another option is to mount a full PowerDNS Authoritative Server configuration on /etc/powerdns/pdns.conf in the container. In this case, all PDNS_ environment variables will be ignored.

Reference

You can find here all available settings.

Examples

Master server with API enabled and with 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_master=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 \
  tmuncks/pdns-server

Slave server with 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_slave=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 \
  tmuncks/pdns-server

docker-pdns-server's People

Contributors

tmuncks avatar

Watchers

James Cloos avatar  avatar

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.