与ZZSRV1上的主DNS配安装一样。
与ZZSRV1上的主DNS配安装一样。
# vi /etc/named.conf 添加如下zone信息 zone "bigcloud.local" IN { type slave; masters {192.168.188.11; }; file "bigcloud.local.zone"; }; zone "188.168.192.in-addr.arpa" IN { type slave; masters {192.168.188.11; }; file "192.168.188.zone"; }; zone "189.168.192.in-addr.arpa" IN { type slave; masters {192.168.188.11; }; file "192.168.189.zone"; };
修改目录权限
[root@zzsrv2 named]# ll /var/named/ -d drwxr-x--- 6 root named 133 Aug 11 14:06 /var/named/ [root@zzsrv2 named]# chmod g+w /var/named/ [root@zzsrv2 named]# ll /var/named/ -d drwxrwx--- 6 root named 133 Aug 11 14:06 /var/named/
启动服务
[root@zzsrv2 ~]# systemctl start named.service Redirecting to /bin/systemctl restart named.service
设置为自动启动
[root@zzsrv2 ~]# systemctl enable named ln -s ‘/usr/lib/systemd/system/named.service‘ ‘/etc/systemd/system/multi-user.target.wants/named.service‘
查看日志,检查是否有报错信息。(建议在启动时,就在另外一个会话时就打开)
# tail -f /var/log/messages
在ZZSRV1上生成了相应的zone文件
[root@zzsrv2 ~]# ll /var/named/ total 28 -rw-r--r-- 1 named named 451 Aug 11 14:58 192.168.188.zone -rw-r--r-- 1 named named 254 Aug 11 15:05 192.168.189.zone -rw-r--r-- 1 named named 647 Aug 11 15:12 bigcloud.local.zone drwxr-x--- 7 root named 56 Aug 11 14:06 chroot drwxrwx--- 2 named named 22 Aug 11 14:19 data drwxrwx--- 2 named named 58 Aug 11 16:20 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 drwxrwx--- 2 named named 6 Jun 10 16:13 slaves [root@zzsrv1 ~]# vi /var/named/bigcloud.local.zone 添加一个A记录 test IN A 10.0.0.1 并且将,zone的序列号增大 [root@zzsrv1 ~]# rndc reload server reload successful 在ZZSRV1的日志中会看到 zone bigcloud.local/IN: sending notifies rial 11)client 192.168.188.12#41658 (bigcloud.loc: transfer of ‘bigcloud.local/IN‘: AXFR-style IXFR startedclient 192.168.188.12#41658 (bigcloud.loc: transfer of ‘bigcloud.local/IN‘: AXFR-style IXFR ended 在ZZSRV2的日志中会看到 client 192.168.188.11#33856: received notify for zone ‘bigcloud.local‘zone bigcloud.local/IN: Transfer started.transfer of ‘bigcloud.local/IN‘ from 192.168.188.11#53: connected using 192.168.188.12#41658zone bigcloud.local/IN: transferred serial 11transfer of ‘bigcloud.local/IN‘ from 192.168.188.11#53: Transfer completed: 1 messages, 13 records, 339 bytes, 0.005 secs (67800 bytes/sec)zone bigcloud.local/IN: sending notifies (serial 11) # nslookup > server 192.168.188.12 Default server: 192.168.188.12 Address: 192.168.188.12#53 > test.bigcloud.local. Server: 192.168.188.12 Address: 192.168.188.12#53 Name: test.bigcloud.local Address: 10.0.0.1 > exit
本文出自 “刘琼@天道酬勤” 博客,请务必保留此出处http://lqiong.blog.51cto.com/8170814/1559061
原文地址:http://lqiong.blog.51cto.com/8170814/1559061