Named cannot start with error "change directory to '/var/named' failed: file not found"

Created:

2016-11-16 13:11:52 UTC

Modified:

2016-12-21 20:10:14 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Named cannot start with error "change directory to '/var/named' failed: file not found"

Symptoms

BIND service ("named") cannot be started. The starting script reports the following error:

    ~# /etc/init.d/named start
Starting named:
Error in named configuration:
/etc/named.conf:6: change directory to '/var/named' failed: file not found
/etc/named.conf:6: parsing failed
[FAILED]

The directory /var/named exists and has the permission "755." What may be causing the problem and how can I resolve it?

Cause

Incorrect settings are specified in the named configuration.

Resolution

Change directory to "/var" in the named configuration file /etc/named.conf:

    options {
allow-recursion {
localnets;
};
directory "/var"; <- set this value
pid-file "/var/run/named/named.pid";
};

Find the place where the file rndc.conf is located, and copy it inside the new jailed environment /var/named/run-root:

    ~# locate rndc.conf
/etc/rndc.conf
~#
~# cp /etc/rndc.conf /var/named/run-root/etc

Or create symlink if file already exists:

    # ln -s /var/named/run-root/etc/named.conf /etc/named.conf

Verify ownership and permissions:

    ~# ls -l /var/named/run-root/etc
-rw-r--r-- 1 root root 480 Jan 23 2002 rndc.conf
~#
Have more questions? Submit a request
Please sign in to leave a comment.