[設定心得] Bind9 View 底下的 master/slave 設定方案域名服务器教程
|
| 论文作者:佚名 论文来源:不详 论文发布时间:2006-6-19 17:58:05 论文发布人:chjchjchj |
减小字体
增大字体
摘要:[設定心得] Bind9 View 底下的 master/slave 設定方案 新版本可從如下獲得: http://www.study-area.org/tips/bind9_view.htm
[設定心得] Bind9 View 底下的 master/slave 設定方案 --------------------------------------- 作者:netman(netman@study-area.org) 版本:v0.01 日期:2004-04-20
* 版本歷程: 1) 2004-04-20 v0.01 - 初版
---------------------------------------
一、前言
bind-9 自問世以來,深受廣大 dns 管理員歡迎(年紀越大越如此... ^_^), 是由於 bind9 提供了許多功能,解決了長期以來深受困擾的 dns 管理難題。
可是在新功能出現後,也帶來了一些前所不曾預料的新問題, 其中之一,就是 view 設定下的 master/slave 的同步問題。
二、問題分析
由於 master 端利用 view 的分界,按照不同的查詢來源位址回應不同的答案。 這對一般的 query 工作是非常有效的。
倘若 master 與 slave 的對外與對內界面均能相互指定路由(這是前提), 那只要在 slave 端不同的 view 內指定 master 的不同 IP ,也能夠順利完成 zone transfer 。
但問題在於,當 slave 端在進行 SOA 查詢及作 XFER 時, 若 master 端只看到 client 端的某一特定來源位址,因而只能回應單一的 view , 那就不能順利完成其他 view 的 zone transfer 。
三、解決方案
我們可利用 bind9 的 transfer-source 功能,在 slave 端指定其用來作 zone transfer 的 source address , 得以讓 master 回應正確的 answer 。
其關鍵點是 slave 需設定多個 IP (可分內外或用 IP Alias),且都能讓 master 路由得到 就行。
四、假設情景
- 假設授權 domain 為 my.domain 。
- 假設 master 的界面分配如下: - External: eth0 1.2.3.4 - Internal: eth1 10.1.2.3
- 假設 slave 的界面分配如下: - Primary: eth0 10.1.2.4 - Alias: eth0:0 10.1.2.5
五、設定細節:
- master 修改 /etc/named.conf ,內容類似如下: [code:1:f86cf03583]acl "lan" { 10.1.2.0/24; };
options { directory { "/var/named"; }; };
view "internal" { match-client { !10.1.2.5; lan; }; // 這裡排除 slave 的另一位址 zone "." IN { type hint; file "named.root"; }; zone "my.domain" IN { type master; file "my.domain.int"; allow-transfer { 10.1.2.4; }; //允許 slave 的 primay 位址 }; };
view "external" { match-client { any; }; recursion no; zone "." IN { type hint; file "named.root"; }; zone "my.domain" IN { type master; file "my.domain.ext"; allow-transfer { 10.1.2.5; }; //允許 slave 的 alias 位址 }; };[/code:1:f86cf03583]
- slave 修改 /etc/named.conf ,內容類似如下: [code:1:f86cf03583]acl "lan" { 10.1.2.0/24; };
options { directory { "/var/named"; }; };
view "internal" { match-client { lan; }; zone "." IN { type hint; file "named.root"; }; zone "my.domain" IN { type slaver; file "slave.my.domain.int"; masters { 10.1.2.3; }; transfer-source 10.1.2.4; // 指定 primay 位址 }; }; view "external" { match-client { any; }; recursion no; zone "." IN { type hint; file "named.root"; }; zone "my.domain" IN { type master; file "slave.my.domain.ext"; masters { 10.1.2.3; }; transfer-source 10.1.2.5; // 指定 alias 位址 }; };[/code:1:f86cf03583]
六、測試:
當設定完成後,只需重新啟動 master/slave 雙方的 bind 服務程式即可。
七、結語:
Bind9 的功能很多是新概念,本文希望對有志探索 bind 這一神奇系統的同好有所幫助,且 起拋磚引玉之用。
八、參考資料:
- O'Reilly, Linux Server Hacks: 100 Industrial-Strength Tips & Tools
---------------本文結束 -----------------------
--
======= http://www.study-area.org ======= 飛雪迎春到﹐風雨送春歸 已是寒崖百丈冰﹐尤有花枝俏 俏也不爭春﹐只把春來報 待得山花爛漫時﹐他在叢中笑﹗
阿骁 回复于:2004-04-20 17:54:52好文!简洁,易懂!
学到新东西啦! 多谢网中人斑竹呀!^_^
强烈要求给精华!!!!
阿骁 回复于:2004-04-22 22:53:04强烈要求放入精华区!!! 我顶
chieh 回复于:2004-04-23 14:29:01好!!!!!!!!!!!!!!!!!!!!!!!!!! 强烈要求放入精华区!!! 我顶
|
|
|
|
|
|
|
| ∷相关技术评论 |
(评论内容只代表网友观点,与本站立场无关!) [查看发表评论...] | |
|
|
| |
站内广告 |
| |
|
站内搜索 |
| |
栏目导航 |
| |
|
|
相关技术 |
 |
|
本月热门 |
| |
|
|
本日热门 |
| |
|
|
|