bind9的view功能(备忘)
在bind9上可以做出你要的功能,在bind8上就只能用两台DNS来做。
用 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";
};
};
联系客服