redhat as 4 版本的DNS設定需要修改幾個檔案。/etc/resolv.conf 本機dns配置檔案/etc/named.conf dns主配置檔案/var/named/chroot/var/named/sdyc.edu.cn.zone 正向區域檔案sdyc.edu.cn.zone,系統預設沒有,需要自己添加/var/named/chroot/var/named /sdyu.edu.cn.zone 正向區域檔案sdyu.edu.cn.zone,系統預設沒有,需要自己添加/var/named/chroot/var/named /76.194.222.fanxiang.zone 反向區域檔案76.194.222.sdyc.edu.cn.zone,系統預設沒有,需要自己添加 [root@dns1 ~]# vi /etc/resolv.confsearch sdyc.edu.cnnameserver 222.194.76.2nameserver 202.102.152.3[root@dns1 ~]# vi /etc/named.conf//// named.conf for Red Hat caching-nameserver// options { directory "/var/named"; dump-file "/var/named/data/cache_dump.db"; statistics-file "/var/named/data/named_stats.txt";/* * 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 "localdomain" IN { type master; file "localdomain.zone"; allow-update { none; };}; zone "localhost" IN { type master; file "localhost.zone"; allow-update { none; };}; zone "sdyc.edu.cn" IN { type master; file "sdyc.edu.cn.zone"; allow-update { none; };};zone "sdyu.edu.cn" IN { type master; file "sdyu.edu.cn.zone"; allow-update { none; };};zone "76.194.222.in-addr.arpa" IN { type master; file "76.194.222.fanxiang.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; };}; include "/etc/rndc.key";[root@dns1 ~]# vi /var/named/chroot/var/named/sdyc.edu.cn.zone$TTL 86400@ IN SOA sdyc.edu.cn. root.sdyc.edu.cn. ( 42 ; serial (d. adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum IN NS dns1.sdyu.edu.cn. IN MX 10 mail.sdyc.edu.cn.www IN A 222.194.76.36mail IN A 222.194.76.35dns1 IN A 222.194.76.2ids IN A 222.194.76.12jpkc IN A 222.194.76.59jw IN A 222.194.76.22my IN A 222.194.76.18oa IN A 222.194.76.20xg IN A 222.194.76.18[root@dns1 ~]# vi /var/named/chroot/var/named/sdyu.edu.cn.zone$TTL 86400@ IN SOA sdyu.edu.cn. root.sdyu.edu.cn. ( 42 ; serial (d. adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum IN NS dns1.sdyu.edu.cn. IN MX 10 mail.sdyu.edu.cn.www IN A 222.194.76.36mail IN A 222.194.76.35dns1 IN A 222.194.76.2ids IN A 222.194.76.12jpkc IN A 222.194.76.59jw IN A 222.194.76.22my IN A 222.194.76.18oa IN A 222.194.76.20xg IN A 222.194.76.18 [root@dns1 ~]# vi /var/named/chroot/var/named/76.194.222.fanxiang.zone $TTL 86400
@ IN SOA sdyu.edu.cn. root.sdyu.edu.cn. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS dns1.sdyu.edu.cn.
IN MX 10 mail.sdyu.edu.cn.
21 IN PTR mail.sdyu.edu.cn.
2 IN PTR dns1.sdyu.edu.cn.
12 IN PTR ids.sdyu.edu.cn.
59 IN PTR jpkc.sdyu.edu.cn.
22 IN PTR jw.sdyu.edu.cn.
18 IN PTR my.sdyu.edu.cn.
20 IN PTR oa.sdyu.edu.cn.
18 IN PTR xg.sdyu.edu.cn.
35 IN PTR mail.sdyc.edu.cn.
本文轉自gaodi2002 51CTO部落格,原文連結:http://blog.51cto.com/gaodi2002/1618176