Setup DNS Server with Docker Container

Quickstart
Start BIND using:

$ sudo docker run --name bind -d --restart=always  --publish 53:53/tcp --publish 53:53/udp --publish 10000:10000/tcp  --volume /opt/docker/bind:/data sameersbn/bind

Login to Webmin with the username root and password password. Specify --env ROOT_PASSWORD=secretpassword on the docker run command to set a password of your choosing.

Persistence

For the BIND to preserve its state across container shutdown and startup you should mount a volume at /data.

The Quickstart command already mounts a volume for persistence.

SELinux users should update the security context of the host mountpoint so that it plays nicely with Docker:

mkdir -p /opt/docker/bind
chcon -Rt svirt_sandbox_file_t /opt/docker/bind

Shell Access

docker exec -it bind bash

Comments