BIND&DNS內(nèi)部培訓(xùn)教程2
(6)主服務(wù)器:
主服務(wù)器是給定域的所有信息的授權(quán)來(lái)源。它所裝載的域信息來(lái)自于由域管理員所創(chuàng)建
并在本地維護(hù)的磁盤(pán)文件。
我們用"test.com"作為例子,我們需要五個(gè)基本配置文件:
/etc/named.conf
/var/named/named.ca
/var/named/named.local
/var/named/named.test.com
/var/named/named.172.16.0
(6.1)創(chuàng)建或修改/etc/named.conf:
// generated by named-bootconf.pl
options {
directory "/var/named";
/*
* 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 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};
//
// a PM nameserver config
北京藍(lán)色先鋒軟件有限公司版權(quán)所有違者必究
地址:北京市北京站東街甲10 號(hào)華安商務(wù)樓6 層
網(wǎng)址: www.bluepioneer.com.cn 郵編:100005 第8 頁(yè)共14 頁(yè)
電話:( 010 ) 65594026 傳真:( 010 ) 65594064
//
zone '.' {
type hint;
file "named.ca";
};
zone '0.0.127.in-addr.arpa' {
type master;
file "named.local";
};
//there are our primary zone files
zone "test.com" {
type master;
file "named.test.com";
};
zone '0.16.172.in-addr.arpa' {
type master;
file 'named.172.16.0';
};
文件中的zone 'test.com'段是聲明這是用于test.com 域的主服務(wù)器,用于該域的數(shù)據(jù)
從/var/named/named.test.com 文件中裝載。
文件中的zone '0.16.172.in-addr.arpa'段是指向映射IP 地址172.16.0.* 到主機(jī)名的
文件。用于該域的數(shù)據(jù)從/var/named/named.172.16.0 文件中裝載。
(6.2)創(chuàng)建或修改/var/named/named.local
@ IN SOA ns.test.com. root.ns.test.com. (
2000051500 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS ns.test.com.
1 IN PTR localhost.
注意:在修改named.*文件時(shí)每次存盤(pán)時(shí)要注意增加Serial 值,如使用絕對(duì)域名時(shí)千萬(wàn)別忘了后面帶的'.'。
資源記錄中的@字符轉(zhuǎn)變?yōu)楫?dāng)前的域test.com,IN 表示資源記錄使用TCP/IP 地址,SOA 表示管轄開(kāi)始記錄.ns.test.com. 是這個(gè)域的主DNS 服務(wù)器的標(biāo)準(zhǔn)名稱,在之后是聯(lián)系的
EMAIL 地址,其中@字符必須用'.'代替。
(6.3)創(chuàng)建或修改/var/named/named.test.com
@ IN SOA ns.test.com. root.ns.test.com. (
2000051500 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS ns.test.com.
ns A 172.16.0.1
ns2 A 172.16.0.11
www A 172.16.0.2
ftp CNAME www.test.com.
mail A 172.16.0.3
MX 10 mail.test.com.
(6.4)創(chuàng)建或修改/var/named/named.172.16.0
@ IN SOA ns.test.com. root.ns.test.com. (
2000051500 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS ns.test.com.
1 IN PTR ns.test.com.
11 IN PTR ns1.test.com.
2 IN PTR www.test.com.
3 IN PTR mail.test.com.
(7)輔服務(wù)器
輔服務(wù)器從主服務(wù)器上獲取域信息的完整拷貝.也能以授權(quán)方式回答有關(guān)域的查詢。我們用'test.com'作為例子,我們需要五個(gè)基本配置文件:
/etc/named.conf
/var/named/named.ca
/var/named/named.local
(7.1)創(chuàng)建或修改/etc/named.conf:
// generated by named-bootconf.pl
options {
directory "/var/named";
/*
* 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 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};
//
// a SM nameserver config
//
zone '.' {
type hint;
file "named.ca";
};
zone '0.0.127.in-addr.arpa' {
type master;
file "named.local";
};
//there are our slave zone files
zone "test.com" {
type slave;
file "named.test.com";
masters {172.16.0.1;};
};
zone '0.16.172.in-addr.arpa' {
type slave;
file 'named.172.16.0';
masters {172.16.0.1;};
};
在文件中'masters {172.16.0.1;};'其中的IP 地址是你網(wǎng)絡(luò)中主服務(wù)器的IP 地址。從主服務(wù)器上拷貝/var/named/named.ca 和/var/named/named.local 這兩個(gè)文件。實(shí)際運(yùn)行的服務(wù)器可以是以上其中一種配置,也能同時(shí)包含多種配置,但所有的系統(tǒng)都應(yīng)該運(yùn)行解析器。
相關(guān)文章
網(wǎng)絡(luò)路由技術(shù)及運(yùn)用4
網(wǎng)絡(luò)路由技術(shù)及運(yùn)用4...2007-09-09三種新型技術(shù)在寬帶綜合城域網(wǎng)中的應(yīng)用
三種新型技術(shù)在寬帶綜合城域網(wǎng)中的應(yīng)用...2007-09-09