Thursday, December 13, 2012

Chroot Bind9 on Debian (Quick and dirty)

This is very short, quick and dirty tutorial about chrooting Bind9 on Debian. This method already tested on Debian Squeeze, but i think suppose to be also run on other Debian variant.

Of course before start, you must have bind packages installed. You can use the magic of "apt-get install bind9" command for installing Bind9 packages.




  • stop bind
  • mkdir -p /var/chroot/bind9/{etc,dev,var/cache/bind,var/run/bind/run}
  • chown -R bind:bind /var/chroot/bind9/var/*
  • mknod /var/chroot/bind9/dev/null c 1 3
  • mknod /var/chroot/bind9/dev/random c 1 8
  • chmod 666 /var/chroot/bind9/dev/{null,random}
  • mv /etc/bind /var/chroot/bind9/etc
  • ln -s /var/chroot/bind9/etc/bind /etc/bind
  • chown -R bind:bind /etc/bind/*
  • echo "\$AddUnixListenSocket /var/chroot/bind9/dev/log" > /etc/rsyslog.d/bind-chroot.conf
  • edit /etc/default/bind9
  • add -t /var/chroot/bind9
  • restart bind and rsyslogd

No comments:

Post a Comment