献给Linux 初学者:
RedHat Linux AS 5.0 的 DNS 配置 已测试成功 ! IP : 1.1.1.10 DNS : www.test.com 在本机配置www ftp mail bind-libbind-devel-9.3.3-7.el5 bind-libs-9.3.3-7.el5 bind-9.3.3-7.el5 bind-devel-9.3.3-7.el5 bind-utils-9.3.3-7.el5 bind-chroot-9.3.3-7.el5 bind-sdb-9.3.3-7.el5 binutils-2.17.50.0.6-2.el5 system-config-bind-4.0.3-2.el5 1.1.1.10 mail.test.com 1.1.1.10 ftp.test.com options { listen-on port 53 { any; }; listen-on-v6 port 53 { ::1; }; directory "/var/named"; dump-file "/var/named/data/cache_dump.d"; statistics-file "/var/named/data/named_stats.txt"; memstatistics-file "/var/named/data/named_mem_stats.txt"; query-source port 53; query-source-v6 port 53; allow-query { any; }; forwarders {202.96.134.133;}; forward only; }; logging { channel default_debug { file "data/named.run"; severity dynamic; }; }; view localhost_resolver { match-clients { any; }; match-destinations { any; }; recursion yes; include "/etc/named.rfc1912.zones";
zone "." IN { type hint; file "named.ca"; };
zone "localdomain" IN { type master; file "localdomain.zone"; allow-update { none; }; };
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 "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN { type master; file "named.ip6.local"; allow-update { none; }; }; zone "255.in-addr.arpa" IN { type master; file "named.broadcast"; allow-update { none; }; };
zone "0.in-addr.arpa" IN { type master; file "named.zero"; allow-update { none; }; }; zone "test.com" IN { type master; file "test.com.zone"; allow-update { none; }; };
zone "1.1.1.in-addr.arpa" IN { type master; file "1.1.1.zone"; allow-update { none; }; };
[root@www named]# vi 1.1.1.zone $TTL 86400 @ IN SOA localhost. root.localhost.( 1997022700 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum IN NS www.test.com. 10 IN PTR www.test.com. 10 IN PTR ftp.test.com. 10 IN PTR mail.test.com. 有必要说明的是最后两句前面的那个10是指的我自己IP:1.1.1.10的最后一个数 $TTL 86400 @ IN SOA localhost root ( 42 ; serial (d. adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum IN NS localhost IN NS www.test.com. IN MX 10 mail.test.com. www IN A 1.1.1.10 mail IN A 1.1.1.10 ftp IN A 1.1.1.10
[root@www named]# cat /etc/resolv.conf nameserver 1.1.1.10 防火墙配置 # setup
检查: [root@www named]# named-checkzone test.com /var/named/test.com.zone zone test.com/IN: loaded serial 42 OK [root@www named]# named-checkzone test.com /var/named/1.1.1.zone zone test.com/IN: loaded serial 1997022700 OK 如出错查看日志 [root@www named]# tail /var/log/messages | grep named
测试: [root@www named]# nslookup ftp.test.com Server: 1.1.1.10 Address: 1.1.1.10#53 Name: ftp.test.com Address: 1.1.1.10
[root@www named]# nslookup localhost Server: 1.1.1.10 Address: 1.1.1.10#53 Name: localhost Address: 127.0.0.1 测试成功!!大功告成!! | ||
|
|
|