快速业务通道

Redhat enterprise 5下 linux配置DNS 之二

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-05-03
m IN NS sina.com. www IN A 192.168.0.5 ~ 保存退出 修改反向区域文件 [root@localhost named]# vi sina.local 修改如下 $TTL 86400 @ IN SOA sina.com. root.sina.com. ( 1997022700 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum IN NS sina.com. 5 IN PTR [url]www.sina.com.[/url] 保存退出 修改属组 [root@localhost named]# ll 总计 88 drwxrwx--- 2 named named 4096 2004-08-25 data -rw-r----- 1 root named 198 2007-07-19 localdomain.zone -rw-r----- 1 root named 195 2007-07-19 localhost.zone -rw-r----- 1 root named 427 2007-07-19 named.broadcast -rw-r----- 1 root named 2518 2007-07-19 named.ca -rw-r----- 1 root named 424 2007-07-19 named.ip6.local -rw-r----- 1 root named 426 2007-07-19 named.local -rw-r----- 1 root named 427 2007-07-19 named.zero -rw-r----- 1 root root 415 04-25 19:48 sina.local -rw-r----- 1 root root 413 04-25 19:43 sina.zone drwxrwx--- 2 named named 4096 2004-07-27 slaves [root@localhost named]# chgrp named sina.local [root@localhost named]# chgrp named sina.zone [root@localhost named]# 重启服务 [root@localhost named]# 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 named]# service named restart Stopping named: [FAILED] Starting named: [ OK ] [root@localhost named]# 测试网络 [root@localhost named]# 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 named]# 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.sina.com.[/url] [root@localhost named]# 反向成功ok 设想一下,怎么样用同一个ip解析sina 和sohu呢 (千万别把windows中的别名CNAME 记录用到这里) [root@localhost named]# vi /var/named/chroot/etc/named.conf 修改此文件,关键部分显示结果如下 zone "sina.com" IN { type master; file "sina.zone"; allow-update { none; }; }; zone "0.168.192.in-addr.arpa" IN { type master; file "sina.local"; allow-update { none; }; }; zone "sohu.com" IN { type master; file "sohu.zone"; allow-update { none; }; }; include "/etc/rndc.key"; 保存退出 [root@localhost named]# cd /var/named/chroot/var/named [root@localhost named]# ls data named.broadcast named.local sina.zone localdomain.zone named.ca named.zero slaves localhost.zone named.ip6.local sina.local [root@localhost named]# cp sina.zone sohu.zone [root@localhost named]# vi sohu.zone 修改sohu的正向区域文件如下 $TTL 86400 @ IN SOA sohu.com. root.sohu.com. ( 1997022700 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum IN NS sohu.com. www IN A 192.168.0.5 保存退出 [root@localhost named]# vi sina.local 修改sina的反响区域文件 ~ $TTL 86400 @ IN SOA sina.com. root.sina.com. (

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站: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号