diff --git a/dns/Dockerfile b/dns/Dockerfile index bfcf937..b34d3c6 100644 --- a/dns/Dockerfile +++ b/dns/Dockerfile @@ -10,6 +10,16 @@ RUN apt-get update && \ traceroute \ && rm -rf /var/lib/apt/lists/* +RUN sed 's/include "\/etc\/bind\/named.conf.default-zones";//g' /etc/bind/named.conf +RUN echo "include \"/etc/dns/master.conf\";" > /etc/bind/named.conf.local + COPY start.sh /start.sh +COPY restart-bind /usr/bin + +RUN mkdir /etc/dns +RUN touch /etc/dns/master.conf + +VOLUME /etc/dns + EXPOSE 53 CMD ["/bin/sh", "/start.sh"] \ No newline at end of file diff --git a/dns/README.md b/dns/README.md new file mode 100644 index 0000000..efe9488 --- /dev/null +++ b/dns/README.md @@ -0,0 +1,5 @@ +# DNS server container + +## Useful commands +* `named-checkconf`: Check Bind9 configuration +* `restart-bind`: Restart Bind9 \ No newline at end of file diff --git a/dns/restart-bind b/dns/restart-bind new file mode 100755 index 0000000..014bbb6 --- /dev/null +++ b/dns/restart-bind @@ -0,0 +1,3 @@ +#!/bin/sh +pkill named +/usr/sbin/named \ No newline at end of file