Menu

#171 DNS Plug-in: chrooted DNS Support

open
Matt
Plugins (87)
5
2009-01-11
2009-01-11
xxx :)
No

I followed this link to setup the chrooted DNS - http://www.howtoforge.com/perfect-server-ubuntu8.04-lts-p4. It worked fine after the setup. Then, after installing OpenQRM 4.3 on Ubuntu 8.04-Server, the chrooted DNS server failed to start:

------------------------------
root@ubuntu804:~# /etc/init.d/bind9 start
* Starting domain name service... bind [fail]
------------------------------

So, I started by tracing the logs in /var/log/syslog, and I found this is due to loading the configuration file, /etc/bind/named.conf.local,

------------------------------
Jan 10 14:01:29 ubuntu804 named[11166]: loading configuration from '/etc/bind/named.conf'
Jan 10 14:01:29 ubuntu804 named[11166]: /etc/bind/named.conf:40: open: /etc/bind/named.conf.local: file not found
Jan 10 14:01:29 ubuntu804 named[11166]: loading configuration: file not found
Jan 10 14:01:29 ubuntu804 named[11166]: exiting (due to fatal error)
------------------------------

The file is actually symlinked to /usr/lib/openqrm/plugins/dns/etc/bind/named.conf.local

------------------------------
root@ubuntu804:~# ls -l /etc/bind/named.conf.local
lrwxrwxrwx 1 root bind 54 2009-01-10 14:00 /etc/bind/named.conf.local -> /usr/lib/openqrm/plugins/dns/etc/bind/named.conf.local
------------------------------

And the file can be viewed:

------------------------------
root@ubuntu804:~# cat /etc/bind/named.conf.local

zone "oqnet.org" IN {
type master;
file "/etc/bind/zones/oqnet.org.in.db";
};

zone "0.168.192.in-addr.arpa" {
type master;
file "/etc/bind/zones/oqnet.org.rev.db";
};
------------------------------

The reason that bind9 failed to start is because that the bind is chrooted, and it only has access to the its "root", /var/lib/named. So, the symlinked /usr/lib/openqrm/plugins/dns/etc/bind/named.conf.local file can't be seen by bind9.

A quick workaround:

First, copy the openqrm specific named.conf.local file the chrooted jail:

-------------------------------
cp /usr/lib/openqrm/plugins/dns/etc/bind/named.conf.local /var/lib/named/etc/bind/named.conf.local.openqrm
-------------------------------

Then, edit /var/lib/named/etc/bind/named.conf to change the last line to,

--------------------------------
// include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.local.openqrm";
--------------------------------

Bind9 now starts fine:

--------------------------------
root@ubuntu804:/var/lib/named/etc/bind# /etc/init.d/bind9 start
* Starting domain name service... bind [ OK ]
--------------------------------

The workaround needs to be performed every time the openqrm server is initialized , as I believe the openqrm init process will edit the /etc/bind/named.conf file to include the symlinked named.conf.local file.

An integrated solution would be more appropriate to resolve this issue.

Discussion


Log in to post a comment.