miércoles, 1 de junio de 2005

Chroot bind (named) en Debian Sid

Los comandos necesarios son:

mkdir -p /var/lib/named/etc
mkdir /var/lib/named/dev
mkdir -p /var/lib/named/var/cache/bind
mkdir /var/lib/named/var/run
mv /etc/bind /var/lib/named/etc
ln -s /var/lib/named/etc/bind /etc/bind
cp /etc/localtime /var/lib/named/etc
mknod /var/lib/named/dev/null c 1 3
mknod /var/lib/named/dev/random c 1 8
mknod /var/lib/named/dev/log c 21 5
chmod 666 /var/lib/named/dev/null /var/lib/named/dev/random
chown bind:bind /var/lib/named
chown -R bind:bind /var/lib/named/etc/bind /var/lib/named/var/*
chmod 700 /var/lib/named

Luego... a?adir en /etc/bind/named.conf.options

pid-file "/var/run/named.pid";
statistics-file "/var/run/named.stats";


Editar /etc/default/bind9 (o /etc/init.d/bind9), la variable
OPTIONS tiene que contener "-u bind -t /var/lib/named" y modificar
todas las rutas que apunten a /var/run/bind/run por /var/run

Editar /etc/init.d/sysklogd y a?adir en la variable OPTIONS
"-a /var/lib/named/dev/log"

Si se usa el sistema de logs del POST pasado, a?adir estos comandos:

mkdir -p /var/lib/named/var/log/named
touch /var/lib/named/var/log/named/dns_logs
touch /var/lib/named/var/log/named/dns_warnings
ln -s /var/lib/named/var/log/named/ /var/log/named
chown bind:bind -R /var/lib/named/var/log/named
chmod o-r -R /var/lib/named/var/log/named