文档章节

BIND(一)—— BIND主从

异类深呼吸
 异类深呼吸
发布于 2014/06/02 12:16
字数 1589
阅读 159
收藏 0
点赞 0
评论 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
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
园区网为主的 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
趣谈js的call和apply两大召唤术

前言 在《趣谈js的bind牌胶水》这篇文章中,我聊到了js的bind胶水,这篇文章我来聊聊js的call和apply这对孪生兄弟。 Why? ——> 为什么会出现apply和call? 在《趣谈js的bind牌胶水》中,我...

hanmin
05/21
0
0
ubuntu server10.4下的主从DNS服务配置

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

wbf961127
2017/11/13
0
0
如何设计一个DNS

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

冯骐
2017/12/29
0
0
Linux学习笔记 DNS服务器常识

  IP<——DNS——>DOMAIN   2.网络传送资料的方法并不是只有TCP/IP协议,比如在LAN里经常用到的可能是NetBIOS   3.DNS的由来   ==>为了解决网络传送资料时IP地址难以记忆的问题,就有...

zt371
2009/05/23
340
0
[C/C++]完整揭秘VS2010关于function和bind的实现

很久之前我就对C++里面的function非常感兴趣,也探究出了一些成果。 [C/C++]std::tr1::function源码剖析(一) [C/C++]std::tr1::function源码剖析(二) 这两篇文章是对VS2010中如何实现fun...

梁欢
2013/10/25
0
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

expect脚本同步文件、expect脚本指定host和要同步的文件、构建文件分发系统

expect脚本同步文件 更改权限 执行脚本 查看执行结果 expect eof需要加上,作用是等脚本命令执行完再进行退出 expect脚本指定host和要同步的文件 更改权限,执行脚本 构建文件分发系统 需求背...

Zhouliang6
41分钟前
1
0
Hive应用:外部分区表

Hive应用:外部分区表 介绍 Hive可以创建外部分区表。创建表的时候,分区要在建表语句中体现。建完之后,你不会在表中看到数据,需要进行分区添加,使用alter语句进行添加。然后数据才会显示...

星汉
51分钟前
3
0
点击Enter登录

1. 效果 2. 实现过程(记得引入jq文件) //6.回车事件 登录 $(function() { document.onkeydown = function(event) { var e = event || window.event || arguments.callee.caller.arguments......

Lucky_Me
56分钟前
1
0
点击菜单内容切换

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> .menu{ height: 38px; background-color: #eeeeee; line-height: 38px; } .mao{ ......

南桥北木
今天
1
0
OSChina 周六乱弹 —— 妹子和游戏哪个更好玩

Osc乱弹歌单(2018)请戳(这里) 【今日歌曲】 @andonny :分享唐朝乐队的单曲《国际歌》 《国际歌》- 唐朝乐队 手机党少年们想听歌,请使劲儿戳(这里) @举个栗子- :日常祈雨 邪恶的大祭...

小小编辑
今天
572
7
流利阅读笔记32-20180721待学习

“人工智能”造假:只有人工,没有智能 Lala 2018-07-21 1.今日导读 当今社会,擅长单个方面的人工智能已经盛行,手机借助 AI 智慧防抖技术帮助大家拍出清晰照片,谷歌研发的 AI 助手将可以帮...

aibinxiao
今天
8
0
我的成长记录(一)

今天突然精神抖擞,在我的博客下新开一项分类>成长记录,专门记录每隔一段时间我的一点感悟吧。因为今天才专门花时间新开这样一个分类,所以以前有过的一些感悟没有记录下来,现在已经想不起...

dtqq
今天
1
0
机器学习管理平台 MLFlow

最近工作很忙,博客一直都没有更新。抽时间给大家介绍一下Databrick开源的机器学习管理平台-MLFlow。 谈起Databrick,相信即使是不熟悉机器学习和大数据的工程湿们也都有所了解,它由Spark的...

naughty
今天
17
0
idea tomcat 远程调试

tomcat 配置 编辑文件${tomcat_home}/bin/catalina.sh,在文件开头添加如下代码。    CATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7829" Idea端配......

qwfys
今天
2
0
遍历目录下的文件每250M打包一个文件

#!/usr/bin/env python # -*- utf-8 -*- # @Time : 2018/7/20 0020 下午 10:16 # @Author : 陈元 # @Email : abcmeabc@163.com # @file : tarFile.py import os import tarfile import thr......

寻爱的小草
今天
1
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

返回顶部
顶部