首页 > 代码库 > CentOS项目实例之三(二)--ZZSRV2上DNS配置
CentOS项目实例之三(二)--ZZSRV2上DNS配置
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"; };
修改目录权限
[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
1.3. 测试BIND
在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
CentOS项目实例之三(二)--ZZSRV2上DNS配置
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。