This docker image provides a bind service based on Alpine Linux.
If you like to use this image, please use a specific version tag like v1.0.0
or the branches latest
, stable
. The other branches are only temporary and will be deleted after the merge into the other branches.
There are two options to start your Bind container.
Use this docker command to run the bind container.
docker run -d --name bind --publish 53:53/udp \
-v /bindconfig:/etc/bind -v /bindlog:/var/log/named \
--restart=always pstauffer/bind:stable
### docker-compose
Check out the docker-compose.yml
file in the git repo.
docker-compose up -d
It's possible to change some variables like the uid/gid of the technical bind user/group or the executed named command. Just pass the variables via docker command to the container or define them in the docker-compose file.
Example of overwrite of the uid/gid.
NAMED_UID=666
NAMED_GID=666
or via docker-compose file:
environment:
- NAMED_UID=666
- NAMED_GID=666
The default ids in the alpine bind package are:
UID=1000
GID=101
It's also possible to add some additional named
command options. Just overwrite the following variable:
COMMAND_OPTIONS=<option>
For example if you like to write all logs to the stoud, then change the variable COMMAND
like this:
COMMAND_OPTIONS=-g
To pass your configuration directory with all configs and files, you've to mount the volume into the docker container with the docker option:
-v <bindconfig>:/etc/bind
Please verify, that the owner of the files is set equal to the uid/gid of the named user/group in the container.
chown 1000:101 <bindconfig>/*
To log the bind logs on your docker host, just mount a directory into the docker container:
-v <logdir>:/var/log/named
Please verify, that the owner of the files is set equal to the uid/gid of the named user/group in the container.
chown 1000:101 <bindconfig>/*
A working bind configuration is provided in the git repo. Just mount this example folder into the docker container and you're bind should work.
You can test the dns responses with dig
or nslookup
on the docker host.
dig webmail.example.com @localhost
nslookup webmail.example.com localhost
This project is licensed under MIT <http://opensource.org/licenses/MIT>
_.