Score:0

bind9 docker container doesn't start after changing named.conf.options

es flag
leo

I started docker bind9 container using ubuntu/bind9 image. but after changing a line of /etc/bind/named.conf.options it won't start.how can i change configuration while it won't start?

here is my information :

#docker ps -a

CONTAINER ID   IMAGE                 COMMAND                  CREATED      STATUS     PORTS     NAMES

57a84dcb93a6   ubuntu/bind9:latest   "docker-entrypoint.sh"   5 days ago   Exited (1) 3 seconds ago             bind9-cntr-01

and :

#docker logs bind9-cntr-01

Starting named...
exec /usr/sbin/named -u "bind" -g ""
08-May-2022 09:15:58.059 starting BIND 9.18.1-1ubuntu1-Ubuntu (Stable Release) <id:>
08-May-2022 09:15:58.059 running on Linux x86_64 5.4.0-109-generic #123-Ubuntu SMP Fri Apr 8 09:10:54 UTC 2022
08-May-2022 09:15:58.059 built with  '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-option-checking' '--disable-silent-rules' '--libdir=${prefix}/lib/x86_64-linux-gnu' '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' '--libdir=/usr/lib/x86_64-linux-gnu' '--sysconfdir=/etc/bind' '--with-python=python3' '--localstatedir=/' '--enable-threads' '--enable-largefile' '--with-libtool' '--enable-shared' '--disable-static' '--with-gost=no' '--with-openssl=/usr' '--with-gssapi=yes' '--with-libidn2' '--with-json-c' '--with-lmdb=/usr' '--with-gnu-ld' '--with-maxminddb' '--with-atf=no' '--enable-ipv6' '--enable-rrl' '--enable-filter-aaaa' '--disable-native-pkcs11' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -ffile-prefix-map=/build/bind9-2SW0bQ/bind9-9.18.1=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fno-strict-aliasing -fno-delete-null-pointer-checks -DNO_VERSION_DATE -DDIG_SIGCHASE' 'LDFLAGS=-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'
08-May-2022 09:15:58.059 running as: named -u bind -g
08-May-2022 09:15:58.059 compiled by GCC 11.2.0
08-May-2022 09:15:58.059 compiled with OpenSSL version: OpenSSL 3.0.2 15 Mar 2022
08-May-2022 09:15:58.059 linked to OpenSSL version: OpenSSL 3.0.2 15 Mar 2022
08-May-2022 09:15:58.059 compiled with libxml2 version: 2.9.13
08-May-2022 09:15:58.059 linked to libxml2 version: 20913
08-May-2022 09:15:58.059 compiled with json-c version: 0.15
08-May-2022 09:15:58.059 linked to json-c version: 0.15
08-May-2022 09:15:58.059 compiled with zlib version: 1.2.11
08-May-2022 09:15:58.059 linked to zlib version: 1.2.11
08-May-2022 09:15:58.059 ---------------------------------------------
08-May-2022 09:15:58.059 BIND 9 is maintained by Internet Systems Consortium,
08-May-2022 09:15:58.059 Inc. (ISC), a non-profit 501(c)(3) public-benefit
08-May-2022 09:15:58.059 corporation.  Support and training for BIND 9 are
08-May-2022 09:15:58.059 available at https://www.isc.org/support
08-May-2022 09:15:58.059 ---------------------------------------------
08-May-2022 09:15:58.059 found 4 CPUs, using 4 worker threads
08-May-2022 09:15:58.059 using 4 UDP listeners per interface
08-May-2022 09:15:58.075 config.c: option 'trust-anchor-telemetry' is experimental and subject to change in the future
08-May-2022 09:15:58.075 loading configuration from '/etc/bind/named.conf' 08-May-2022 09:15:58.075 /etc/bind/named.conf.options:22: unknown option 'reccursion' 08-May-2022 09:15:58.075 loading configuration: failure 08-May-2022 09:15:58.075 exiting (due to fatal error)

PS: I know where did i have mistake, but i can't start the container to correct it.

cn flag
Is the `/etc/bind/named.conf` stored on a volume or mounted into the container?
leo avatar
es flag
leo
I'm a little confused about best way to storing config data into volumes or container, but in this case it is stored on container.
cn flag
Then delete the container and start again with the configuration files mounted in
leo avatar
es flag
leo
thank you for your consideration
Score:2
bd flag

Ideally, you would know which host file the path /etc/bind/named.conf.options of your docker container is mapped to, and edit that directly without starting the container.

Alternatively, you can start the container with an interactive shell with the options -it --entrypoint sh.

leo avatar
es flag
leo
actually my problem is that i didn't bind /etc/bind/ to my docker host, so i don't have access to to the file while container is not running. and as i'm new to docker , could you help me more with alternative option?
Tilman Schmidt avatar
bd flag
In that case your change will be gone after destroying the container. Just remove it with `docker rm` and recreate it from its image with `docker run`, this time binding `/etc/bind`.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.