ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 用 bind 9.xx 的 view 功能可以实现 dns 对不同网段返回不同的地址

用 bind 9.xx 的 view 功能可以实现 dns 对不同网段返回不同的地址

原创 Linux操作系统 作者:mhaoy 时间:2010-08-18 16:34:55 0 删除 编辑
在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";
       };
};

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/15149581/viewspace-671313/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: SAP技术概述
请登录后发表评论 登录
全部评论

注册时间:2009-05-13

  • 博文量
    54
  • 访问量
    107220