It is not necessary to run named in a chroot environment if the
Red Hat SELinux policy for named is enabled. When enabled, this policy is
far more secure than a chroot environment.
下面不指明根目录是默认采用bind安装目录/var/bind为基本路径。所有操作均在其子目录中进行。
生成rndc.conf:
在sbin目录中使用命令:./rndc-confgen > ../etc/rndc.conf
生成named.conf:
etc目录中使用命令:
tail -10 rndc.conf | head -9 | sed s/#\ //g > named.conf
在/var/bind目录中, 新建立更改context为下面类型:
[root@localhost bind]# ls -Z
drwxr-xr-x root root system_ubject_r:bin_t bin
drwxr-xr-x root root system_ubject_r:etc_t etc
drwxr-xr-x root root system_ubject_r:var_t include
drwxr-xr-x root root system_ubject_r:usr_t lib
drwxr-xr-x root root system_ubject_r:sbin_t sbin
drwxr-xr-x root root system_ubject_r:var_t var
在var目录中建立log named run 3个子目录,并更改context为:
[root@localhost var]# ls -Z
drwxr-xr-x root root system_u:object_r:var_log_t log
drwxr-x--- root named system_u:object_r:named_zone_t named
drwxr-xr-x root root system_u:object_r:var_run_t run