Generic BIND server docker container.
This container is meant for testing purposes and it is supposed to be configured as needed.
Default config answers requests for www.domain.com with the IP 1.2.3.4
docker build -t binddock .
docker run --name binddock -i -d -t binddock
To test the DNS server:
$ BINDsrv=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' binddock)
$ nslookup - $BINDsrv
> www.domain.com
Server: 172.17.0.2
Address: 172.17.0.2#53
Name: www.domain.com
Address: 1.2.3.4
>
- Enter the container shell:
$ docker attach binddock
root@a1eba089c6e5:~#
-
Exit the container (without killing the process):
Press'Ctrl+p
, followed byCtrl+q
-
Terminate the container:
$ docker kill binddock
- Restart the container:
$ docker start binddock
- Remove the container:
$ docker kill binddock