Re: Problems chrooting BIND 9.2.2 in a Solaris 8 box

Joseph Tam <[email protected]> Fri, 12 Mar 2004 14:22:27 -0800 (PST)
Newsgroups gmane.comp.security.sun,gmane.comp.security.basics
Message-ID <[email protected]>
On Thu, 11 Mar 2004, GARCIA CABALLERO Jordi wrote:

> Chrooting BIND 9.2.2 in a Solaris 8 02/2002 box, I get this weird error when
> running named in the jail:
>
> # /usr/sbin/chroot /export/home/dns /usr/local/sbin/named -u named
>
> What I see from the console
>
> Mar 11 18:26:15 oasv020 named[11788]: /etc/named.conf:16: change directory
> to '/dns/etc' failed: file not found
> Mar 11 18:26:15 oasv020 named[11788]: /etc/named.conf:16: parsing failed
> Mar 11 18:26:15 oasv020 named[11788]: loading configuration: file not found
> Mar 11 18:26:15 oasv020 named[11788]: exiting (due to fatal error)

I believe that chroot-ing from the command line will chroot the daemon
too early (i.e. before it has time to grab the prerequisite files) and
consequently, all file references are relative to the chroot jail directory.
You may be better off using the -t parameter and let named chroot itself.

I discovered this while playing around with trying to do exactly what
you were doing (chroot-ing right from the start -- it requires that
you set up all the dynamic library and /etc files beforehand or making
a statically linked executable, a grisly tasks).  You may find this useful:

	http://www.math.ubc.ca/~tam/BIND/Notes.txt

I have since moved on to using DJBDNS, which I recommend.

Joseph Tam <[email protected]>