###子域授权###
slave(192.168.8.12):
[root@dns-s1 slaves]# vim /etc/named.conf
32 forwarders { 192.168.8.11; }; ##指明父服务器
66 zone "ll.bss.com" IN {
67 type master;
68 file "ll.com.zone";
69 };
##注释以下行
78 #include "/etc/named.rfc1912.zones";
79 #include "/etc/named.root.key";
[root@dns-s1 slaves]# cd ..
[root@dns-s1 named]# ls
data dynamic named.ca named.empty named.localhost named.loopback slaves
[root@dns-s1 named]# cp -p named.localhost ll.com.zone
[root@dns-s1 named]# vim ll.com.zone
$TTL 1D
@ IN SOA yy.ll.bss.com. root (
2013 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS yy.ll.bss.com.
yy A 192.168.8.12
lyq A 192.168.8.13
bss A 192.168.8.14
[root@dns-s1 named]# vim /etc/resolv.conf
nameserver 192.168.8.12 ##指向本机自己
[root@dns-s1 named]# systemctl restart named
#########################
master
[root@dns named]# vim /etc/named.conf
###注释以下内容
108 #include "/etc/named.rfc1912.zones";
109 #include "/etc/named.root.key";
[root@dns named]# vim bss.com.zone
@ IN SOA dns.bss.com. dns (
201908
1D
1H
1W
1H )
IN NS dns.bss.com.
dns.bss.com. A 192.168.8.11
www A 192.168.8.12
ftp A 192.168.8.13
ll.bss.com. NS yy.ll.bss.com. ##添加子域名
yy.ll.bss.com. A 192.168.8.12
[root@dns named]# systemctl restart named
##########################################################
测试:
M:
[root@dns named]# host www.bss.com
www.bss.com has address 192.168.8.12
[root@dns named]# host lyq.ll.bss.com
lyq.ll.bss.com has address 192.168.8.13
[root@dns named]# host yy.ll.bss.com
yy.ll.bss.com has address 192.168.8.12
S:
[root@dns-s1 named]# host www.bss.com
www.bss.com has address 192.168.8.12
[root@dns-s1 named]# host lyq.ll.bss.com
lyq.ll.bss.com has address 192.168.8.13
[root@dns-s1 named]# host yy.ll.bss.com
yy.ll.bss.com has address 192.168.8.12