1、安装相关组件
yum -y install bind bind-chroot(bind-chroot为可选组件)
2、配置文件
①chroot环境:
vi /etc/named/chroot/etc/named.conf
options{
directory "/var/named/chroot/var/named/";
};
zone "user.test.com" IN {
type master;
file "user.test.com.zone";
allow-update { none; };
};
vi /var/named/chroot/var/named/user.test.com.zone
$ TTL 86400
@ IN SOA user.test.com root (
2017070301
1H
10M
7D
1D
)
@ IN NS user.test.com.
user.test.com. IN A 192.168.1.110
②非chroot环境
vi /etc/named.conf
options{
directory "/var/named";
};
zone "user.test.com" IN {
type master;
file "user.test.com.zone";
allow-update { none; };
};
vi /var/named/user.test.com.zone
$ TTL 86400
@ IN SOA user.test.com root (
2017070301
1H
10M
7D
1D
)
@ IN NS user.test.com.
user.test.com. IN A 192.168.1.110
3、启动服务:
systemctl start named