在局域网中有一台DNS服务器(运行BIND),对网内的机器进行域名解析,请问该如何配置这台服务器,使之在网内的客户机在该服务器上很难找到DNS记录时自动到外网的DNS服务器上查找,不要告诉我在客户机上配置二个DNS服务器地址.
请老大们指教,谢谢!

阿骁 回复于:2003-01-13 10:12:55
假如您的dns配置好了,自动就会实现您要的功能啊!

torrent 回复于:2003-01-13 10:16:55
不是吧,楼上;应该是使用FORWORD命令来实现。

戈壁-胡杨 回复于:2003-01-13 10:27:43
#vi/etc/named.conf
options {
directory "/var/named";
datasize 2098;
forward only;
forwarders {
99.11.33.44;#第二个解析主机
};
recursion no;
transfers-in 10;
transfers-per-ns 2;
allow-transfer {
127.0.1.1/24;
};
};


阿骁 回复于:2003-01-13 10:31:44
楼上的,假如使用了 forward 指令,那么dns收到用户的查询请求时并不在本机上进行查询解析,而是将查询请求转发到您指定的那台dns server上去! :) (不信,您能够查查bind 的用户手册!)

laoxia 回复于:2003-01-13 10:42:57
[quote][b]下面引用由[u]阿骁[/u]在 [i]2003/01/13 10:31am[/i] 发表的内容:[/b]
楼上的,假如使用了 forward 指令,那么dns收到用户的查询请求时并不在本机上进行查询解析,而是将查询请求转发到您指定的那台dns server上去! :) (不信,您能够查查bind 的用户手册!)
[/quote]
本域内的他还解析,超出本域的FORWARD到外边

阿骁 回复于:2003-01-13 10:49:03
[quote][b]下面引用由[u]laoxia[/u]在 [i]2003/01/13 10:42am[/i] 发表的内容:[/b]
本域内的他还解析,超出本域的FORWARD到外边
[/quote]

对的!


hanccy 回复于:2003-01-13 10:59:17
是呀!是这样的!通过实践的!呵呵!阿骁知错了?^-^

阿骁 回复于:2003-01-13 11:01:40
呵呵 。。。 我是理解错了。

hrcxf 回复于:2003-01-13 11:30:56
A. 我们的机器环境:

Solaris 8 sparc Bind 8 (Solaris 8 附带)


B. IP规划:

domain: abc.com
DNS Server: solaris8.abc.com 132.254.254.76
网段: 132.254.254.xxx umask 255.255.255.0
客户机器: RedHat 6.2 u2.abc.com 132.254.254.120
SCO unxi5.0.5 sco.abc.com 132.254.254.92
HP-UX 11.0 punk.abc.com 132.254.254.7
win98 kun.abc.com 132.254.254.70
C.配置文档

1.在Solaris8 上建立文档: (这个文档一般需要自己手工输入)

/etc/named.conf


//
// BIND Version 8 configuration file.
//

options {
directory "/etc/named.data"; //用户自己随便定义一个目录
dump-file "/etc/named.data/tmp/named_dump.db";
};

zone "abc.com" in {
type master;
file "db.abc.com";
};

zone "254.254.132.in-addr.arpa" in {
type master;
file "db.132.254.254";
};

zone "0.0.127.in-addr.arpa" in {
type master;
file "db.127.0.0";
};

zone "." in {
type hint;
file "db.cache";
};

//
//
// The following file contains real examples of how special BIND 8
// configurations can be created. These configurations will get
// appended to the /etc/named.conf file after all of the standard
// DNS entries are created. In most cases it will not be necessary
// to add anything here, but if it is necessary, here are a couple
// of examples.
//
// server 204.33.116.7 {
// transfers 2;
// };
//
// topology {
// 15/8;
// 172.88/16;
// };
//
//

2.Solaris8 上注意修改这个文档/etc/nsswitch.conf

# You must also set up the /etc/resolv.conf file for DNS name
# server lookup. See resolv.conf(4).
hosts: files dns #注意那个dns,必须有哦

3./etc/resolc.conf

nameserver 132.254.254.76 #您的DNS server ip
domain abc.com #默认的domain

4.编辑 /etc/named.data/127.0.0

@ IN SOA ns.abc.com. ben.abc.com. ( 2000091311 10800 3600 604800 864
00 
IN NS ns.abc.com.
IN NS u2.abc.com.
1 IN PTR localhost.

5.编辑 /etc/named.data/db.132.254.254

254.254.132.in-addr.arpa. IN SOA ns.abc.com. ben.abc.com. (
2000091322
10800
3600
604800
86400 
254.254.132.in-addr.arpa. IN NS ns.abc.com.
254.254.132.in-addr.arpa. IN NS u2.abc.com.
76.254.254.132.in-addr.arpa. IN PTR solaris8.abc.com.
70.254.254.132.in-addr.arpa. IN PTR kun.abc.com.
77.254.254.132.in-addr.arpa. IN PTR punk.abc.com.

6.编辑 /etc/named.data/db.abc.com

//From here....
abc.com.INSOA ns.abc.com. ben.abc.com. (
2000091328
10800
3600
604800
86400 
madebyunxiaid IN TXT "This map made by unixaid.net" //一个optional,能够不要
abc.com. IN NS ns.abc.com.
abc.com. IN MX 20 solaris8.abc.com.
localhost IN A 127.0.0.1
solaris8.abc.com. IN A 132.254.254.76 http://www.abc.com./ IN CNAME solaris8.abc.com. //CNAME代表这个是个机器solaris8.abc.com的别名
kun.abc.com. IN A 132.254.254.70
linux.abc.com. IN CNAME U2.abc.com.
ftp.abc.com. IN CNAME solaris8.abc.com.
mail.abc.com. IN CNAME solaris8.abc.com.
punk.abc.com. IN A 132.254.254.77
u2.abc.com. IN A 132.254.254.120

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!