A dockerized and customizable DNS Server based on bind9
This Docker image is based on the ubuntu/bind9 image maintained by Canonical.
Every Docker container created from this image has the following standard network configuration:
| Name Server | A Record |
|---|---|
| ns1.bushido.local | 172.100.0.2 |
| host1.bushido.local | 172.100.0.3 |
| host2.bushido.local | 172.100.0.4 |
| DNS Forwarder |
|---|
| 8.8.8.8 |
| 8.8.4.4 |
If you need to change the DNS Server configuration you need to jump into the container and edit the following files:
Or even better you should write a Dockerfile similar to the one below so you can copy new configuration files into it:
FROM drcoccodrillus/bind9:latest
COPY named.conf.options /etc/bind/
COPY named.conf.local /etc/bind/
COPY db.bushido.local /etc/bind/zones/
Using this dockerized version of Bind9 is pretty simple. Just follow the steps below in order to make it working on your system.
docker run -d --name=dns-server --net=bushido-network --ip=172.100.0.2 drcoccodrillus/bind9
docker run -d --rm --name=host1 --net=bushido-network --ip=172.100.0.3 --dns=172.100.0.2 ubuntu:22.04 /bin/bash -c "while :; do sleep 10; done"
docker run -d --rm --name=host2 --net=bushido-network --ip=172.100.0.4 --dns=172.100.0.2 ubuntu:22.04 /bin/bash -c "while :; do sleep 10; done"
docker exec -it host1 /bin/bash
ping 172.100.0.4
Content type
Image
Digest
sha256:41e57fcc3…
Size
71.8 MB
Last updated
over 3 years ago
docker pull drcoccodrillus/bind9