文档章节

BIND(一)—— BIND主从

异类深呼吸
 异类深呼吸
发布于 2014/06/02 12:16
字数 1589
阅读 160
收藏 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
朝阳
系统管理员
私信 提问
博主干货:DNS原理及实战配置指南

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

好笔记运维
06/26
0
0
ubuntu server10.4下的主从DNS服务配置

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

wbf961127
2017/11/13
0
0
园区网为主的 DNS 架构设计

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

作者: Freedomkk_qfeng
2017/10/17
0
0
客户端的socket是否需要bind?

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

Freewheel
2015/05/02
0
6
关于js的bind牌胶水,了解一下?

前言 今天聊一聊js中的bind方法,主要从三个维度来阐述:why——>what——>how。文章虽经个人多次校验,对语言表述、代码书写等进行了认真审核,但仍免不了有疏漏之处,如若发现,还望指出,...

hanmin
05/14
0
0

没有更多内容

加载失败,请刷新页面

加载更多

微服务分布式事务实现

https://www.processon.com/view/link/5b2144d7e4b001a14d3d2d30

WALK_MAN
今天
2
0
《大漠烟尘》读书笔记及读后感文章3700字

《大漠烟尘》读书笔记及读后感文章3700字: 在这个浮躁的社会里,你有多久没有好好读完一本书了? 我们总觉得自己和别人不一样,所以当看到别人身上的问题时,很少有“反求诸己”,反思自己。...

原创小博客
今天
3
0
大数据教程(9.5)用MR实现sql中的jion逻辑

上一篇博客讲解了使用jar -jar的方式来运行提交MR程序,以及通过修改YarnRunner的源码来实现MR的windows开发环境提交到集群的方式。本篇博主将分享sql中常见的join操作。 一、需求 订单数据表...

em_aaron
今天
3
0
十万个为什么之什么是resultful规范

起源 越来越多的人开始意识到,网站即软件,而且是一种新型的软件。这种"互联网软件"采用客户端/服务器模式,建立在分布式体系上,通过互联网通信,具有高延时(high latency)、高并发等特点...

尾生
今天
3
0
Terraform配置文件(Terraform configuration)

Terraform配置文件 翻译自Terraform Configuration Terraform用文本文件来描述设备、设置变量。这些文件被称为Terraform配置文件,以.tf结尾。这一部分将讲述Terraform配置文件的加载与格式。...

buddie
今天
5
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部