CentOS 7
Ads

Enable Chroot Environment
2014/07/10
  Configute Chroot Environment if you want.
Simply install "bind-chroot" package to do so. If you edit named.conf or other zone files on chroot environment, edit configuration files under /var/named/chroot/.
[root@dlp ~]#
yum -y install bind-chroot
[root@dlp ~]#
/usr/libexec/setup-named-chroot.sh /var/named/chroot on

[root@dlp ~]#
systemctl stop named

[root@dlp ~]#
systemctl disable named

[root@dlp ~]#
systemctl start named-chroot

[root@dlp ~]#
systemctl enable named-chroot

ln -s '/usr/lib/systemd/system/named-chroot.service' '/etc/systemd/system/multi-user.target.wants/named-chroot.service'
[root@dlp ~]#
ll /var/named/chroot/etc

total 24
-rw-r--r-- 1 root root   331 Jul 10 14:46 localtime
drwxr-x--- 2 root named    6 Jun 10 17:13 named
-rw-r----- 1 root named 2211 Jul 10 14:13 named.conf
-rw-r--r-- 1 root named 2389 Jun 10 17:13 named.iscdlv.key
-rw-r----- 1 root named  931 Jun 21  2007 named.rfc1912.zones
-rw-r--r-- 1 root named  487 Jul 19  2010 named.root.key
drwxr-x--- 3 root named   24 Jul 10 14:46 pki
-rw-r----- 1 root named   77 Jul 10 14:39 rndc.key
[root@dlp ~]#
ll /var/named/chroot/var/named

total 28
-rw-r--r-- 1 root  root   358 Jul 10 14:31 0.0.10.db
drwxr-x--- 7 root  named   56 Jul 10 14:46 chroot
drwxrwx--- 2 named named   22 Jul 10 14:39 data
drwxrwx--- 2 named named 4096 Jul 10 14:42 dynamic
-rw-r----- 1 root  named 2076 Jan 28  2013 named.ca
-rw-r----- 1 root  named  152 Dec 15  2009 named.empty
-rw-r----- 1 root  named  152 Jun 21  2007 named.localhost
-rw-r----- 1 root  named  168 Dec 15  2009 named.loopback
-rw-r--r-- 1 root  root   350 Jul 10 14:30 srv.world.lan
drwxrwx--- 2 named named    6 Jun 10 17:13 slaves
 
Tweet