一.在成功安装redhat8.0后,在终端模式下的SETUP设置中查看NAMED是否正常,以确定你的DNS已启动.至于8.0中DNS的安装就不介绍了,很简单.只要用
rpm qa|grep bind
查看一下安装是否全
二.先介绍一下DNS的配置文件:
/etc/named.conf 要配置 /etc/resolv.conf 要配置 /etc/host.conf 要配置 /var/named/named.local 系统自带,不需要修改 /var/named/named.ca 系统自带,不需要修改 /var/named/163.com.hosts 要配置 /var/named/111.99.222.hosts 要配置
三.开如配置工作,以下是我个人的实例,已在网上测试成功
1 /etc/host.conf ------------------------------------------------------------------- order hosts,bind multi on ------------------------------------------------------------------- 2 /etc/named.conf -------------------------------------------------------------------- // generated by named-bootconf.pl
options { directory "/var/named"; /* * 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; 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 "163.com" IN { type master; file "163.com.hosts"; allow-update { none;}; }; zone "111.99.222.in-addr.arpa" IN{ type master; file "111.99.222.hosts"; allow-update { none;}; };
include "/etc/rndc.key"; ------------------------------------------------------------------
3. /etc/resolv.conf ------------------------------------------------------------------ nameserver 222.99.111.88 domain 163.com ------------------------------------------------------------------
4. /var/named/163.com.hosts ------------------------------------------------------------------- ; ; zone file for 163.com ; $TTL 86400 @ IN SOA ns.163.com. root.163.com. ( 2003010800 ; serial 28800 ; refresh 14400 ; retry 3600000 ; expire 86400 ) ; minimum ; IN NS ns.163.com. IN MX 10 mail.163.com. ; localhost IN A 127.0.0.1 IN A 222.99.111.88 ns IN A 222.99.111.88 mail IN A 222.99.111.88 ftp IN A 222.99..111.99 proftp IN A 222.99.111.88 linux IN A 222.99.111.66 ; www CNAME ns www2 CNAME proftp ; ;EOF -------------------------------------------------------------------------
5. 111.99.222.hosts ------------------------------------------------------------------------ ;Begin $TTL 86400 @ IN SOA ns.163.com. root.163.com.( 20030106 ;serial 28800 ;refresh 7200 ;retry 604800 ;expire 86400) ;minimum TTL IN NS ns.163.com. ; ; ; server ; 88 PTR 163.com. 88 PTR ns.163.com. 88 PTR mail.163.com. 99 PTR ftp.163.com. 88 PTR proftp.163.com. 66 PTR linux.163.com. ;EOF -------------------------------------------------------------------------------------------
四.重新启动NAMED
/etc/rc.d/init.d/service named restart or /etc/rc.d/init.d/service xinetd restart
五.用nslookup查看DNS运行状态.啊!我成功了!
在MOZILLA里看了看不错! 相信你也会成功!
|