1. ZZSRV2上的DNS配置
1.1. 安装BIND
与ZZSRV1上的主DNS配安装一样。
1.2. 配置
1.2.1. Cache Only Server
与ZZSRV1上的主DNS配安装一样。
1.2.2. 添加辅助Zone
# 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"; };
修改目录权限
[[email protected] named]# ll /var/named/ -d drwxr-x--- 6 root named 133 Aug 11 14:06 /var/named/ [[email protected] named]# chmod g+w /var/named/ [[email protected] named]# ll /var/named/ -d drwxrwx--- 6 root named 133 Aug 11 14:06 /var/named/
启动服务
[[email protected] ~]# systemctl start named.service Redirecting to /bin/systemctl restart named.service
设置为自动启动
[[email protected] ~]# 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
1.3. 测试BIND
在ZZSRV1上生成了相应的zone文件
[[email protected] ~]# 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 [[email protected] ~]# vi /var/named/bigcloud.local.zone 添加一个A记录 test IN A 10.0.0.1 并且将,zone的序列号增大 [[email protected] ~]# 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
时间: 2024-11-29 02:15:07