Domain-Name-System

BIND拆分視圖DNS配置問題

  • January 29, 2011

我們有兩台 DNS 伺服器:一台由我們的 ISP 控制的外部伺服器和一台由我們控制的內部伺服器。我希望 foo.example.com 的內部請求映射到 192.168.100.5,外部請求繼續映射到 1.2.3.4,所以我試圖在綁定中配置一個視圖。不幸的是,當我嘗試重新載入配置時,綁定失敗。我確定我錯過了一些簡單的東西,但我無法弄清楚它是什麼。

options {
       directory "/var/cache/bind";
       forwarders {
        8.8.8.8;
        8.8.4.4;
       };
       auth-nxdomain no;    # conform to RFC1035
       listen-on-v6 { any; };
};
zone "." {
       type hint;
       file "/etc/bind/db.root";
};
zone "localhost" {
       type master;
       file "/etc/bind/db.local";
};
zone "127.in-addr.arpa" {
       type master;
       file "/etc/bind/db.127";
};
zone "0.in-addr.arpa" {
       type master;
       file "/etc/bind/db.0";
};
zone "255.in-addr.arpa" {
       type master;
       file "/etc/bind/db.255";
};
view "internal" {
     zone "example.com" {
             type master;
             notify no;
             file "/etc/bind/db.example.com";
     };
};
zone "example.corp" {
       type master;
       file "/etc/bind/db.example.corp";
};
zone "100.168.192.in-addr.arpa" {
       type master;
       notify no;
       file "/etc/bind/db.192";
};

為了簡化配置,我已經排除了視圖中允許遞歸遞歸的條目。如果我刪除視圖並直接載入example.com區域,它工作正常。

關於我可能遺漏的任何建議?

發布結果named

首先,檢查你的日誌,但我想你忘記了

acl "lan_hosts" {
   192.168.0.0/24;             # network address of your local LAN
   127.0.0.1;              # allow loop back
};
view "internal" {
       match-clients { lan_hosts; };   
[...]
};

引用自:https://serverfault.com/questions/143827