sameersbn / docker-bind

Dockerize BIND DNS server with webmin for DNS administration
MIT License
919 stars 333 forks source link

DNS failing with error "loading configuration: permission denied" #96

Open aquarial opened 4 years ago

aquarial commented 4 years ago

After this commit DNS kept failing with the following error:

20-Jun-2020  the working directory is not writable
20-Jun-2020  loading configuration: permission denied
20-Jun-2020  exiting (due to fatal error)

This happens because bind9 9.16.1 needs to write some files into the current directory as the bind user. entrypoint.sh stays in the / directory, so it consistently fails. The old 9.11 didn't write to the current directory, so it didn't matter.

I fixed this locally by adding the following to entrypoint.sh:

mkdir /tmp/working_dir
chown ${BIND_USER} /tmp/working_dir
cd /tmp/working_dir

Hopefully this helps someone searching for a similar question.

carlosgrillet commented 1 year ago

For me what works was add this to my named.conf.options file

options {
    directory "/var/cache/bind";
};

I was having the exact same error