From 0e54866e469c16bde0239b5af90dbf11d4cb147b Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 26 Sep 2024 15:57:19 +0200 Subject: [PATCH] Improve Bind9 configuration --- dns/Dockerfile | 10 ++++++++++ dns/README.md | 5 +++++ dns/restart-bind | 3 +++ 3 files changed, 18 insertions(+) create mode 100644 dns/README.md create mode 100755 dns/restart-bind 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