歡迎您光臨本站 註冊首頁

配置bind view后,啟動bind 出現錯誤!!!

←手機掃碼閱讀     火星人 @ 2014-03-05 , reply:0

配置bind view后,啟動bind 出現錯誤!!!

我配置完bind view后,無法啟動bind ,察看 /var/log/messages日誌文件,發現如下提示:
Mar  2 10:49:32 named: starting BIND 9.3.2 -c /opt/modules/named/etc/named.conf
Mar  2 10:49:32 named: found 4 CPUs, using 4 worker threads
Mar  2 10:49:32  named: loading configuration from '/opt/modules/named/etc/named.conf'
Mar  2 10:49:32  named: /opt/modules/named/etc/named.conf:82: unknown option 'view'
Mar  2 10:49:32 named: loading configuration: failure

無論怎麼修改都出現如下提示,麻煩各位老大幫忙解答??:oops:以下是我的named.conf文件內容。

options {
        directory       "/opt/modules/named/etc/namedb";
        pid-file        "/var/run/named/pid";
        dump-file       "/var/dump/named_dump.db";
        statistics-file "/var/stats/named.stats";

// If named is being used only as a local resolver, this is a safe default.
// For named to be accessible to the network, comment this option, specify
// the proper IP address, or delete this option.
        listen-on       {xxx.xxx.xxx.xxx; };

// If you have IPv6 enabled on this system, uncomment this option for
// use as a local resolver.  To give access to the network, specify
// an IPv6 address, or the keyword "any".
//      listen-on-v6    { ::1; };

// In addition to the "forwarders" clause, you can force your name
// server to never initiate queries of its own, but always ask its
// forwarders only, by enabling the following line:
//
//      forward only;

// If you've got a DNS server around at your upstream provider, enter
// its IP address here, and enable the line below.  This will make you
// benefit from its cache, thus reduce overall DNS traffic in the Internet.
/*
        forwarders {
                202.106.46.151;
        };
*/
        /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND versions 8 and later
         * use a pseudo-random unprivileged UDP port by default.
         */
        // query-source address * port 53;
};

// If you enable a local name server, don't forget to enter 127.0.0.1
// first in your /etc/resolv.conf so this server will be queried.
// Also, make sure to enable it in /etc/rc.conf.


acl "cnc" {xxx.xxx.xxx.xxx;};

acl "telecom" {xxx.xxx.xxx.xxx;};


view "cnc" {
        match-clients { cnc; };
        recursion yes;
zone "." IN {
        type hint;
        file "named.root";
};

zone "localhost" IN {
        type master;
        file "localhost.rev";
};

zone "0.0.127.IN-ADDR.ARPA" {
        type master;
        file "named.local";
};
include "master/cnc.def";
};


view "telecom" {
        match-clients { telecom; };
        recursion yes;
zone "." {
        type hint;
        file "named.root";
};

zone "localhost" IN {
        type master;
        file "localhost.rev";
};

zone "0.0.127.IN-ADDR.ARPA" {
        type master;
        file "named.local";
};

[ 本帖最後由 yutaka.shi 於 2007-3-4 14:04 編輯 ]
《解決方案》

經過測試我發現一個問題,我的named.conf中只能存在一個view組,將telecom屏蔽或將cnc屏蔽都可以正常啟動,如果兩個view組同時工作就會在 /var/log/messages日誌文件報錯
Mar  2 10:49:32 named: /opt/modules/named/etc/named.conf:82: unknown option 'view'
Mar  2 10:49:32 named: loading configuration: failure

不知道有沒有人於遇見過這個問題~!!


如下修改就可以正常啟動bind和完成域名解析,可是如果只能使用一個view,就失去的view的作用了阿,
acl "cnc" {xxx.xxx.xxx.xxx;};

acl "telecom" {xxx.xxx.xxx.xxx;};


view "cnc" {
        match-clients { cnc; };
        recursion yes;
zone "." IN {
        type hint;
        file "named.root";
};

zone "localhost" IN {
        type master;
        file "localhost.rev";
};

zone "0.0.127.IN-ADDR.ARPA" {
        type master;
        file "named.local";
};
include "master/cnc.def";
};


#view "telecom" {
#        match-clients { telecom; };
#       recursion yes;
#zone "." {
#        type hint;
#        file "named.root";
#};

#zone "localhost" IN {
#        type master;
#       file "localhost.rev";
#};

#zone "0.0.127.IN-ADDR.ARPA" {
#        type master;
#        file "named.local";
#};

[ 本帖最後由 yutaka.shi 於 2007-3-4 14:04 編輯 ]
《解決方案》

頂一下,請各位老大幫幫忙,為什麼我的配置文件裡面只能使用一個view!!!!
《解決方案》

頂一下,請各位幫忙啊
《解決方案》

使用bind9配置比較麻煩,我推薦你使用wimydns智能解析系統,架設dns伺服器很容易,Bind9把配置信息保存文本文件,只能手工修改,且修改文件需要重啟DNS服務才能生效,不適用DNS自助解析,WinMyDNS是把DNS配置信息全部保存在ACCESS或MSSQL資料庫中,只要對資料庫的記錄增\減\修改\就可以進行DNS自助解析。winmydns性能也比bind9好,可在普通的機器上支持幾十萬個域名的解析,而且WinMyDNS是基於目前全球使用廣泛、最容易使用Windows平台,而Bind9及MyDNS都是基於界面不友好的Unix平台。所以在功能上都起著領先地位,有免費下載:
http://www.winiis.com/download/WinMyDNS_V1.32.rar

有關此問題也可以聯繫我qq:529226441
《解決方案》

1.首先要將acl 放在所有view的前面
2.一定要有一個view 的選項是 match-clients {any;}; 來匹配剩下的地址(比如不屬於網通和電信的其他地址) 再你的例子中應該再加個view other {match-clients {any;}; } 否則解析不會正常

附件是一個例子  分為中國和中國以外的解析範例 希望對你有幫助 (裡面有named.conf 和 acl)
《解決方案》

原帖由 fuhualgd 於 2007-3-7 10:08 發表
1.首先要將acl 放在所有view的前面
2.一定要有一個view 的選項是 match-clients {any;}; 來匹配剩下的地址(比如不屬於網通和電信的其他地址) 再你的例子中應該再加個view other {match-clients {any;}; } 否則解 ...

目前我就是這種結構,可是只要有一個以上的view組就會無法啟動bind,出現unknown option 'view',只要去掉一個view組就可以。
鬱悶死我了,就是找不到問題。下面是我的設置:

acl "cnc" {xxx.xxx;};

view "cnc_net" {
        match-clients { cnc; };
        recursion no;
zone "." IN {
        type hint;
        file "named.root";
};

zone "localhost" IN {
        type master;
        file "localhost.rev";
};

zone "0.0.127.IN-ADDR.ARPA" {
        type master;
        file "named.local";
};
include "master/cnc.def";

};


view "telecom_net" {
        match-clients { any; };
        recursion no;
zone "." IN {
        type hint;
        file "named.root";
};

zone "localhost" IN {
        type master;
        file "localhost.rev";
};

zone "0.0.127.IN-ADDR.ARPA" {
        type master;
        file "named.local";
};
include "master/telecom.def";

};
《解決方案》

頂一下,期待有人能幫幫忙
《解決方案》

回復 8樓 yutaka.shi 的帖子

include "master/cnc.def";
include "master/telecom.def";

把這2句去掉 然後用named-chkconf 檢查一下
然後在重啟試試看?
《解決方案》

用named-chkconf 可以通過嗎?
估計是少了}; 了。

[ 本帖最後由 total 於 2007-3-11 01:20 編輯 ]

[火星人 ] 配置bind view后,啟動bind 出現錯誤!!!已經有911次圍觀

http://coctec.com/docs/service/show-post-40741.html