发信人: cinc(Commander)
整理人: hackerbay(2002-09-06 16:48:52), 站内信件
|
用 bind 9.xx 的 view 功能可以实现 dns 对不同网段返回不同的地址
named.conf 有以下内容:
-------------------------------------------------------------------
view "internal" {
// This should match our internal networks.
match-clients { 10.0.0.0/8; };
// Provide recursive service to internal clients only.
recursion yes;
zone "." {
type hint;
file "/etc/namedb/named.root";
};
zone "0.0.127.IN-ADDR.ARPA" {
type master;
file "/etc/namedb/localhost.rev";
};
// Provide a complete view of the mydomain.com zone
// including addresses of internal hosts.
zone "mydomain.com" {
type master;
file "/etc/namedb/zone.mydomain.com.internal";
};
};
view "external" {
match-clients { any; };
// Refuse recursive service to external clients.
recursion no;
// Provide a restricted view of the mydomain.com zone
// containing only publicly accessible hosts.
zone "mydomain.com" {
type master;
file "/etc/namedb/zone.mydomain.com.external";
};
};
-------------------------------------------------------------------
不知你是不是想做成这样?
【 在 wienne 的大作中提到:】
:bind 8.3.1
:主机名 ns1
:
:ns1只有一个网卡,配有一个私有地址
:在路由器上做了一个NAT,指向ns1的私有地址
:
:......
---- 前途是光明的
道路是曲折的
|
|