快速业务通道

linux 下DNS的配置三 辅DNS的配置

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-05-03
}; // // a caching only nameserver config // controls { inet 127.0.0.1 allow { localhost; } keys { rndckey; }; }; zone "." IN { type hint; file "named.ca"; }; zone "localhost" IN { type master; file "localhost.zone"; allow-update { none; }; }; zone "0.0.127.in-addr.arpa" IN { type master; file "named.local"; allow-update { none; }; }; zone "sina.com" IN { type slave; file "slaves/sina.zone"; masters { 192.168.0.5; }; }; zone "0.168.192.in-addr.arpa" IN { type slave; file "slaves/sina.local"; masters { 192.168.0.5; }; }; zone "sohu.com" IN { type slave; file "slaves/sohu.zone"; masters { 192.168.0.5; }; }; include "/etc/rndc.key"; -- INSERT -- 保存退出 这里需要注意的是,建议源文件尽量不要动,复制后在进行操作,注意标点符号(;)少了没有 这里类型 换成辅DNS (type slave;) 存储位置 应该是(file "slaves/sina.zone";) 还有就是标明哪个是主DNS (masters { 192.168.0.5; };)注意里面的空格 [root@localhost etc]# service network restart Shutting down interface eth0: [ OK ] Shutting down loopback interface: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: [ OK ] [root@localhost etc]# 重启服务 这时我们可以ping一下 看看网通不通 [root@localhost etc]# ping 192.168.0.5PING 192.168.0.5 (192.168.0.5) 56(84) bytes of data. 64 bytes from 192.168.0.5: icmp_seq=1 ttl=64 time=1.20 ms 64 bytes from 192.168.0.5: icmp_seq=2 ttl=64 time=0.165 ms 64 bytes from 192.168.0.5: icmp_seq=3 ttl=64 time=0.164 ms 64 bytes from 192.168.0.5: icmp_seq=4 ttl=64 time=0.186 ms 64 bytes from 192.168.0.5: icmp_seq=5 ttl=64 time=0.180 ms --- 192.168.0.5 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4000ms rtt min/avg/max/mdev = 0.164/0.380/1.205/0.412 ms [root@localhost etc]# 也可以 telnet一下他的53号端口 [root@localhost etc]# telnet 192.168.0.5 53 Trying 192.168.0.5... Connected to [url]www.sina.com[/url] (192.168.0.5). Escape character is ''^]''. ^] telnet> quit Connection closed. [root@localhost etc]# (^])这个符号是按住ctrl 右(]})的,之后选择quit 退出 这时我们找到slaves目录,看看他的下面有没有把主DNS中的正向和反向区域文件复制过来 [root@localhost etc]# cd /var/named/chroot/var/named [root@localhost named]# ls data localhost.zone named.ca named.local slaves localdomain.zone named.broadcast named.ip6.local named.zero [root@localhost named]# cd slaves [root@localhost slaves]# ls sina.local sina.zone sohu.zone [root@localhost slaves]# 文件复制的没有问题,接下来我们来测试一下 [root@localhost slaves]# nslookup [url]www.sina.com[/url] Server: 127.0.0.1 Address: 127.0.0.1#53 Name: [url]www.sina.com[/url] Address: 192.168.0.5 [root@localhost slaves]# nslookup [url]www.sohu.com[/url] Server: 127.0.0.1Address: 127.0.0.1#53 Name: [url]www.sohu.com[/url] Address: 192.168.0.5 [root@localhost slaves]# nslookup 192.168.0.5 Server: 127.0.0.1 Address: 127.0.0.1#53 5.0.168.192.in-addr.arpa name = [url]www.sohu.com.[/url] 5.0.168.192.in-addr.arpa name = [url]ww

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号