文档章节

BIND(一)—— BIND主从

异类深呼吸
 异类深呼吸
发布于 2014/06/02 12:16
字数 1589
阅读 159
收藏 0

<h2 style="font-size: 24px; -webkit-print-color-adjust: exact; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #cccccc; font-family: Helvetica, arial, sans-serif; margin-top: 0px !important;">BIND(一)-- BIND主从</h2> <h4 style="font-size: 16px; -webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-family: Helvetica, arial, sans-serif;">系统环境</h4> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">Distribution : CentOS 6.5 <br />minimal Bind version : 9.8.2 <br />Init system : sysvinit </code></pre> <h4 style="font-size: 16px; -webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-family: Helvetica, arial, sans-serif;">安装之前</h4> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">1.关闭selinux <br />2.清空防火墙 </code></pre> <h4 style="font-size: 16px; -webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-family: Helvetica, arial, sans-serif;">安装步骤</h4> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">- 安装操作系统 <br />- 安装bind和bind工具 <br />- 安装bind master <br />- 安装bind slave <br />- 同步区域记录 </code></pre> <h4 style="font-size: 16px; -webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-family: Helvetica, arial, sans-serif;">演示环境</h4> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">master:node128 <br />slave :node129 </code></pre> <h3 style="font-size: 18px; -webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-family: Helvetica, arial, sans-serif;">step1:安装bind</h3> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">[root@node128 ~]# yum list all | grep '^bind' <br />bind.x86_64 32:9.8.2-0.23.rc1.el6_5.1 updates <br />bind-chroot.x86_64 32:9.8.2-0.23.rc1.el6_5.1 updates <br />bind-devel.i686 32:9.8.2-0.23.rc1.el6_5.1 updates <br />bind-devel.x86_64 32:9.8.2-0.23.rc1.el6_5.1 updates <br />bind-dyndb-ldap.x86_64 2.3-5.el6 base <br />bind-libs.i686 32:9.8.2-0.23.rc1.el6_5.1 updates <br />bind-libs.x86_64 32:9.8.2-0.23.rc1.el6_5.1 updates <br />bind-sdb.x86_64 32:9.8.2-0.23.rc1.el6_5.1 updates <br />bind-utils.x86_64 <br /><br />//作为最基本的dns服务器,就需要安装bind基本包和bind-utils工具包 <br /># yum install bind bind-utils -y <br /><br />[root@node128 ~]# rpm -qc bind <br />/etc/logrotate.d/named <br />/etc/named.conf //主配置文件 <br />/etc/named.iscdlv.key <br />/etc/named.rfc1912.zones //区域配置文件 <br />/etc/named.root.key <br />/etc/rndc.conf //接管bind的工具 <br />/etc/rndc.key //区域传输的key <br />/etc/sysconfig/named <br />/var/named/named.ca <br />/var/named/named.empty <br />/var/named/named.localhost <br />/var/named/named.loopback </code></pre> <h3 style="font-size: 18px; -webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-family: Helvetica, arial, sans-serif;">step2:最小化的master配置</h3> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">#修改主配置文件 <br />[root@node128 ~]# vim /etc/named.conf <br /><br />options { <br />// listen-on port 53 { 127.0.0.1; }; <br />// listen-on-v6 port 53 { ::1; }; <br />// allow-query { localhost;}; <br /><br />//ps:此时就可以启动了,这时候启动的dns服务器只能起到缓存dns作用,即缓存dns服务器 </code></pre> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">#修改区域配置文件 <br />[root@node128 ~]# /etc/named.rfc1912.zones <br />//新增一个区域 <br />zone "test.com" IN { //这个正向区域名称就是自定义的,公司内部的域名 <br />type master; <br />file "test.com.zone" //指定正向区域文件 <br />}; <br /><br />//type类型:{master | slave | forward} </code></pre> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">#修改区域文件,新增正向解析文件,这个名称就是上面指定的名称 <br />$TTL 600 <br />@ IN SOA dns.test.com. admin.test.com. ( <br />20140601 <br />2H <br />10M <br />7D <br />6H) <br />IN NS dns <br />IN MX 10 mail <br />dns IN A 172.16.213.128 <br />mail IN A 172.16.213.140 <br />www IN A 172.16.213.130 <br />www IN A 172.16.213.131 <br />ftp IN CNAME www <br /><br />//注: <br />1.每个区域文件中必须要有一个NS记录,用来告知到某台机器上查询该区域信息 <br />2.上面的NS的值dns是省略写法,完整写法可以是 dns.test.com.(后面的“.”不可省略) <br />3.zone的记录开头如果省略,表示和上面的一条zone_name相同 <br />4.邮件中10为优先级,另外邮件记录中的@必须要用“.”代替 <br />5.可以为同一个host定义两个A记录,实现了负载均衡的作用,默认采用轮训机制 <br />6.CNAME就是别名设置 </code></pre> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">//新增反向区域 <br />[root@node128 ~]# cp /var/named/test.com.zone /var/named/172.16.213.zone <br /><br /></code></pre> <pre style="margin: 1em 0px; padding: 5px; -webkit-print-color-adjust: exact; font-size: 12px; line-height: 18px; font-family: Monaco, 'Courier New', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; background-color: #eeeeee; border: 1px solid #dddddd; color: #444444; overflow: auto; -webkit-box-shadow: rgba(0, 0, 0, 0.0666667) 0px 1px 2px inset; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="margin: 0px; padding: 0px; -webkit-print-color-adjust: exact; line-height: normal; font-family: Monaco, 'Courier New', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; border: none;">$TTL 600 <br />@ IN SOA dns.test.com. admin.test.com. ( <br />20140601 <br />2H <br />10M <br />7D <br />6H) <br />IN NS dns.test.com. <br />128 IN PTR dns.test.com. <br />129 IN PTR mail.test.com. <br />130 IN PTR www.test.com. <br />131 IN PTR www.test.com.</code></pre> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">//区域文件权限和属组的设定 <br />[root@node128 named]# chown :named test.com.zone 172.16.213.zone <br />[root@node128 named]# chmod 640 test.com.zone 172.16.213.zone <br /><br />//检查区域配置文件语法 <br />[root@node128 ~]# named-checkzone test.com /var/named/test.com.zone <br />zone test.com/IN: loaded serial 20140601 <br />OK <br /><br />[root@node128 named]# named-checkzone "213.16.172.in-addr.arpa" 172.16.213.zone <br />zone 213.16.172.in-addr.arpa/IN: loaded serial 20140601 <br />OK <br /><br />//检查主配置文件语法错误 <br />[root@node128 ~]# named-checkconf //不报错就是正确 <br />[root@node128 ~]# /etc/init.d/named reload </code></pre> <h3 style="font-size: 18px; -webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-family: Helvetica, arial, sans-serif;">step3:测试</h3> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">#常规检测使用dig,hostname,nslookup即可 <br />#dig完全区域传送 <br />[root@node128 named]# dig -t axfr test.com @172.16.213.128 <br /><br />test.com. 600 IN SOA dns.test.com. admin.test.com. 20140601 7200 600 604800 21600 <br />test.com. 600 IN NS dns.test.com. <br />test.com. 600 IN MX 10 mail.test.com. <br />dns.test.com. 600 IN A 172.16.213.128 <br />ftp.test.com. 600 IN CNAME www.test.com. <br />mail.test.com. 600 IN A 172.16.213.129 <br />www.test.com. 600 IN A 172.16.213.130 <br />www.test.com. 600 IN A 172.16.213.131 <br />test.com. 600 IN SOA dns.test.com. admin.test.com. 20140601 7200 600 604800 21600 <br /><br />;; Query time: 1 msec <br />;; SERVER: 172.16.213.128#53(172.16.213.128) <br />;; WHEN: Sat May 31 23:29:17 2014 <br />;; XFR size: 9 records (messages 1, bytes 229) </code></pre> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">[root@node128 named]# dig -x 172.16.213.128 <br />;; QUESTION SECTION: <br />;128.213.16.172.in-addr.arpa. IN PTR <br /><br />;; AUTHORITY SECTION: <br />16.172.in-addr.arpa. 5 IN SOA 16.172.in-addr.arpa. . 0 28800 7200 604800 86400 </code></pre> <h2 style="font-size: 24px; -webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #cccccc; font-family: Helvetica, arial, sans-serif;">安装slave</h2> <blockquote style="border-left-color: #dddddd; margin: 15px 0px; padding: 0px 15px; -webkit-print-color-adjust: exact; color: #777777; font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 22px;"> <p style="-webkit-print-color-adjust: exact; margin: 0px;">这里的slave是针对某个区域而言,这里只演示了正向区域的slave,反向解析的slave同理</p> </blockquote> <h3 style="font-size: 18px; -webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-family: Helvetica, arial, sans-serif;">step1:安装bind</h3> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">[root@node129 ~]# yum install bind bind-utils -y </code></pre> <h3 style="font-size: 18px; -webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-family: Helvetica, arial, sans-serif;">step2:编辑配置文件</h3> <blockquote style="border-left-color: #dddddd; margin: 15px 0px; padding: 0px 15px; -webkit-print-color-adjust: exact; color: #777777; font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 22px;"> <p style="-webkit-print-color-adjust: exact; margin: 0px;">如果有多台DNS服务器,必须为每个DNS服务器建立NS记录,否则master将不会向slave发送通知</p> </blockquote> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">1.在master上新增关于从的NS解析 <br />[root@node129 ~]# vim /var/named/test.com.zone <br />IN NS dns2 <br />dns2 IN A 172.16.213.129 </code></pre> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">2.修改主配置文件 <br />[root@node129 ~]# vim /etc/named.conf <br />// listen-on port 53 { 127.0.0.1; }; <br />// listen-on-v6 port 53 { ::1; }; <br />// allow-query { localhost; }; </code></pre> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">3.新增从服务器区域配置 <br />[root@node129 ~]# vim /etc/named.rfc1912.zones <br />zone "test.com" IN { <br />type slave; <br />file "slaves/test.com.zone"; <br />masters { 172.16.213.128; }; <br />}; </code></pre> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">4.master上修改区域配置文件 <br />[root@node128 ~]# vim /etc/named.rfc1912.zones <br />zone "test.com" IN { <br />type master; <br />file "test.com.zone"; <br />notify yes; //给区域内解析的NS发送通知 <br />allow-transfer { 172.16.213.129; }; //允许传送的地址,也就是slave的地址 <br />also-notify { 172.16.213.129; }; //只通知到某台机器 <br />}; </code></pre> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">5.启动 <br />[root@node128 ~]# /etc/init.d/named start </code></pre> <h3 style="font-size: 18px; -webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-family: Helvetica, arial, sans-serif;">step3:测试</h3> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">1.区域文件是否正确同步过来 <br />[root@node129 ~]# ll /var/named/slaves/ <br />total 4 <br />-rw-r--r-- 1 named named 418 Jun 1 15:34 test.com.zone </code></pre> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">2.完成一次完全区域传送 <br />[root@node129 ~]# dig -t axfr test.com @172.16.213.129 <br /><br />; &lt;&lt;&gt;&gt; DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 &lt;&lt;&gt;&gt; -t axfr test.com @172.16.213.129 <br />;; global options: +cmd <br />test.com. 600 IN SOA dns.test.com. admin.test.com. 20140601 7200 600 604800 21600 <br />test.com. 600 IN MX 10 mail.test.com. <br />test.com. 600 IN NS dns.test.com. <br />dns.test.com. 600 IN A 172.16.213.128 <br />ftp.test.com. 600 IN CNAME www.test.com. <br />mail.test.com. 600 IN A 172.16.213.129 <br />www.test.com. 600 IN A 172.16.213.130 <br />www.test.com. 600 IN A 172.16.213.131 <br />test.com. 600 IN SOA dns.test.com. admin.test.com. 20140601 7200 600 604800 21600 <br />;; Query time: 0 msec <br />;; SERVER: 172.16.213.129#53(172.16.213.129) <br />;; WHEN: Sun Jun 1 15:38:51 2014 <br />;; XFR size: 9 records (messages 1, bytes 229) </code></pre> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">3.使用nslookup进行解析测试 <br />[root@node129 ~]# nslookup <br />&gt; server 172.16.213.129 //指定查询服务器为slave <br />Default server: 172.16.213.129 <br />Address: 172.16.213.129#53 <br />&gt; set q=A //查询A记录 <br />&gt; www.test.com <br />Server: 172.16.213.129 <br />Address: 172.16.213.129#53 <br /><br />Name: www.test.com <br />Address: 172.16.213.131 <br />Name: www.test.com <br />Address: 172.16.213.130 <br />&gt; set q=NS //NS记录 <br />&gt; test.com <br />Server: 172.16.213.129 <br />Address: 172.16.213.129#53 <br /><br />test.com nameserver = dns2.test.com. <br />test.com nameserver = dns.test.com. <br />&gt; set q=MX //MX记录 <br />&gt; test.com <br />Server: 172.16.213.129 <br />Address: 172.16.213.129#53 <br /><br />test.com mail exchanger = 10 mail.test.com. </code></pre> <pre style="margin: 15px 0px; font-size: 13px; -webkit-print-color-adjust: exact; background-color: #f8f8f8; border: 1px solid #cccccc; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><code style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">4.日志 <br />master更新配置文件,BIND日志记录在/var/log/messages中 <br />master上 <br />Jun 1 17:02:52 node128 named[1137]: reloading configuration succeeded <br />Jun 1 17:02:52 node128 named[1137]: reloading zones succeeded <br />Jun 1 17:02:52 node128 named[1137]: zone test.com/IN: loaded serial 20140606 <br />Jun 1 17:02:52 node128 named[1137]: zone test.com/IN: sending notifies (serial 20140606) <br />Jun 1 17:02:52 node128 named[1137]: client 172.16.213.129#36692: transfer of 'test.com/IN': AXFR-style IXFR started <br />Jun 1 17:02:52 node128 named[1137]: client 172.16.213.129#36692: transfer of 'test.com/IN': AXFR-style IXFR ended <br /><br />slave上 <br />Jun 1 17:12:45 node129 named[1432]: client 172.16.213.128#40901: received notify for zone 'test.com' <br />Jun 1 17:12:45 node129 named[1432]: zone test.com/IN: Transfer started. <br />Jun 1 17:12:45 node129 named[1432]: transfer of 'test.com/IN' from 172.16.213.128#53: connected using 172.16.213.129#36692 <br />Jun 1 17:12:45 node129 named[1432]: zone test.com/IN: transferred serial 20140606 <br />Jun 1 17:12:45 node129 named[1432]: transfer of 'test.com/IN' from 172.16.213.128#53: Transfer completed: 1 messages, 12 records, 285 bytes, 0.001 secs (285000 bytes/sec) <br />Jun 1 17:12:45 node129 named[1432]: zone test.com/IN: sending notifies (serial 20140606) </code></pre> <p style="-webkit-print-color-adjust: exact; margin-top: 15px; margin-right: 0px; margin-left: 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; line-height: 22px; margin-bottom: 0px !important;">到了这里,简单的主从就完成了,后面紧接着进行BIND的view和ACL</p>

© 著作权归作者所有

共有 人打赏支持
异类深呼吸
粉丝 5
博文 46
码字总数 42368
作品 0
朝阳
系统管理员
ubuntu server10.4下的主从DNS服务配置

前言:这几天在ubuntu server 10.4下配置主从DNS服务时,总是不成功,今天终于把这个困扰我快一个星期的问题解决了,很是高兴,记录下来,以备后用。 实验环境: (1)ubserver5配置为主DNS...

wbf961127
2017/11/13
0
0
博主干货:DNS原理及实战配置指南

DNS原理及实战配置指南 家住海边喜欢浪:zhang789.blog.51cto.com 目录 DNS简介 DNS域名结构介绍 顶级域名 DNS工作原理 工作模式和端口 资源记录 安装bind(详细) 实战:配置一个正反向解析...

好笔记运维
06/26
0
0
园区网为主的 DNS 架构设计

前言 DNS 这个东西,可大可小,可简单可复杂。对于以园区网为主的传统企业/单位而言,要考虑多出口的链路优化,智能解析,私有域名的解析 ,监控,管理等一系列问题,还是需要有一个好的设计...

作者: Freedomkk_qfeng
2017/10/17
0
0
redis 4.0.2主从

192.168.3.1-主 192.168.3.2-从 修改主从配置文件的/usr/local/redis/redis.conf bind 0.0.0.0——修改侦听在任意网卡;默认侦听在127.0.0.1;不修改主从无法相互访问redis port 6379 ——如...

rm_rf_db
2017/11/05
0
0
客户端的socket是否需要bind?

bind() 函数的定义与作用—— 将一本地地址与一套接口捆绑。本函数适用于未连接的数据报或流类套接口,在connect()或listen()调用前使用。 当用socket()创建套接口后,它便存在于一个名字空间...

Freewheel
2015/05/02
0
6

没有更多内容

加载失败,请刷新页面

加载更多

Mac OS X下Maven的安装与配置

Mac OS X 安装Maven: 下载 Maven, 并解压到某个目录。例如/Users/robbie/apache-maven-3.3.3 打开Terminal,输入以下命令,设置Maven classpath $ vi ~/.bash_profile 添加下列两行代码,之后...

TonyStarkSir
今天
3
0
关于编程,你的练习是不是有效的?

最近由于工作及Solution项目的影响,我在重新学习DDD和领域建模的一些知识。然后,我突然就想到了这个问题,以及我是怎么做的? 对于我来说,提升技能的项目会有四种: 纯兴趣驱动的项目。即...

问题终结者
今天
3
0
打开eclipse出现an error has occurred see the log file

解决方法: 1,打开eclipse安装目录下的eclipse.ini文件; 2,打开的文本文件最后添加一行 --add-modules=ALL-SYSTEM 3,保存重新打开Eclipse。...

任梁荣
昨天
4
0
搞定Northwind示例数据库,无论哪个版本的SQLServer都受用

Northwind数据库 从这里可以找到突破口: http://social.msdn.microsoft.com/Forums/zh-CN/Vsexpressvb/thread/8490a1c6-9018-40c9-aafb-df9f79d29cde 下面是MSDN: http://msdn2.microsoft......

QQZZFT
昨天
1
0
mysql主从同步,安装配置操作

准备 两台mysql服务,我这里准备了如下: 主库:192.168.176.128 从库:192.168.176.131 如何在Linux上安装mysql服务,请看https://blog.csdn.net/qq_18860653/article/details/80250499 操作...

小致dad
昨天
5
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部