|
|
|
[
来路:21kn.com 时间:2007-7-11 15:19:36
点击: ] |
|
|
|
|
|
Redhat9.0 下DNS配置笔记作者:andrew_ai(小艾)环境:企业局域网系统:Redhat9.0,并设有三个段的IP(四网卡),分别是192.168.2.7 ; 192.168.6.7 ; 192.168.10.7需配置文件:1./etc/named.conf(系统自带)2./var/named/2.168.192.file(自建)3./var/named/6.168.192.file(自建)4./var/named/10.168.192.file(自建)5./var/named/mytest.com6./etc/host.conf 跟很多菜菜们一样,我配置DNS也是一波三折,人都搞晕掉了,查了很多资料也问了很多人,但得到的结果始终是那句:Can''''t find ...。一怒之下,把自带的BIND干掉,重新安装了与之相关的所有套件再配置。嘿嘿...搞定!!!,后来怀疑可能是套件有问题或者是并没有装全(未经考证)。小弟我谨以此文章感谢所有无私网友的奉献精神,并希望它能带给正处困境中的Linuxer一点帮助或启示。一、安装BIND: 1.下载如下套件:bind-devel-9.2.1-16.i386.rpmbind-utils-9.2.1-16.i386.rpmbind-9.2.1-16.i386.rpmcaching-nameserver-7.2-7.noarch.rpm2.如有自带BIND先除去。在rpm -e bind时可能出现错误提示: [root@andrew root]# rpm -e binderror: Failed dependencies:bind = 9.2.1 is needed by (installed) bind-devel-9.2.1-16bind is needed by (installed) caching-nameserver-7.2-7bind >= 9.1.3-0.rc2.3 is needed by (installed) caching-nameserver-7.2-7 那就得先将提示的几个套件先移除。3.安装BIND及相关。rpm -ivh xxx.rpm即可。当然,我把自带BIND移除也是被逼无路,迫不得已的之行为,对于高手们来说可能完全不必要。二、具体配置及说明:###named.conf// generated by named-bootconf.ploptions {directory "/var/named"; ##指定DNS文件所在的目录/** If there is a firewall between you and nameservers you want* to talk to, you might need to uncomment the query-source* directive below. Previous versions of BIND always asked* questions using port 53, but BIND 8.1 uses an unprivileged* port by default.*/// query-source address * port 53;};//// a caching only nameserver config//controls {inet 127.0.0.1 allow { localhost; } keys { rndckey; };};zone "." IN {type hint; ##为named建立高速缓存信息file "named.ca"; ##指向根域名服务器};zone "localhost" IN { ##本地主机正向解析配置(自带)type master; ##声明named对指定的域具有控制权,并使named从指定的区域加载信息file "localhost.zone";allow-update { none; };};zone "0.0.127.in-addr.arpa" IN { #本地反向解析配置(自带)type master;file "named.local"; ##用于在本地转换回送地址allow-update { none; };};zone "10.168.192.in-addr.arpa" IN { ##IP为10段的反向解析设置type master;file "10.168.192.file";};zone "2.168.192.in-addr.arpa" IN { ##IP为2段的反向解析设置type master;file "2.168.192.file";};zone "6.168.192.in-addr.arpa" IN { ##IP为6段的反向解析设置type master;file "6.168.192.file";};zone "mytest.com" IN { ##正向解析设置type master;file "mytest.com";};include "/etc/rndc.key";###10.168.192.file ; 6.168.192.file ; 2.168.192.file(反向解析文件,分别建立三个文件,内容相同)$TTL 86400@ IN SOA mytest.com. root.mytest.com.(###这个区信息文件的版本号,用它来确定这个区信息的文件是何时改变的。2 ; Serial###辅助域名服务器在试图检查主域名服务器的SOA记录之前应等待的秒数28800 ; Refresh###辅助服务器在主服务器不能使用时,重试对主服务器的请求应等待的秒数。14400 ; Retry###辅助服务器在不能与主服务器取得联系的情况下丢掉区信息之前应等待的秒数,一般应该设置成30天左右3600000 ; Expire###当没有指定ttl资源记录时默认的ttl值(一般默认的就行了)86400 ) ; Minimum@ IN NS mytest.com.7 IN PTR www.mytest.com.### mytest.com (正向解析文件)$TTL 86400@ IN SOA mytest.com. root.mytest.com.(2 ; serial28800 ; refresh7200 ; retry604880 ; expiry86400 ; minimum)@ IN NS mytest.com.localhost IN A 127.0.0.1www IN A 192.168.10.7www IN A 192.168.2.7www IN A 192.168.6.7####resolv.conf 用于当配置转换程序使用BIND域名服务查询主机时,我们必须告诉转换程序使用哪一个域名服务器。domain mytest.comnameserver 192.168.10.7nameserver 192.168.2.7nameserver 192.168.6.7search localhost###host.conf (按照哪种顺序来尝试不同的名字解析机制)###DNS一般设置先用bind,否则先解析hosts的话,容易让你产生误会。最好不要去设置/etc/hosts文件。order bind hosts三、检测。 用nslookup,输入www.mytest.com看是否配置成功。这里需要注意一点,服务器上的DNS一定要设为本机的IP,而不能设成IPS的DNS。至于为什么嘛,很简单自己想想就明白了。按以上配置方法反正我是屡配不爽。四、说明 因每个人情况不同,以上所述仅供参考。
|
|
|
::::站长友情提示:多花一分钟学点什么都好::::
|
|
|
|
|
|
|
|
|
|
|
|
=
= 免责声明 = = |
|
①
欢迎转载我网所刊信息,请注明“来源:E天下网络”。
② 凡本网注明“来源:XXX(非E天下网络)”的作品,均转载自其它媒体,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如因作品内容、版权和其它问题需要同本网联系的,请在30日内进行。
※联系方式:Airtofly@163.com |
|
|
|
|
|
|