国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
DNS—bind安裝與配置的關(guān)鍵技術(shù)揭秘
一.、Bind 簡介。
Bind是一款開放源碼的DNS服務(wù)器軟件,Bind由美國加州大學(xué)Berkeley分校開發(fā)和維護(hù)的,全名為Berkeley InternetName Domain它是目前世界上使用最為廣泛的DNS服務(wù)器軟件,支持各種unix平臺(tái)和windows平臺(tái)。本文將介紹它在Red hatLinux 9中最基本的安裝和配置。
二.、軟件的相關(guān)資源。
官方網(wǎng)站:http://www.bind.com/
源碼軟件包:Bind 是開源的軟件,可以去其官方網(wǎng)站下載。http://www.isc.org/index.pl/sw/bind/ ,目前最新版本為bind-9.3.1。
幫助文檔:http://www.isc.org/index.pl/sw/bind/ 有該軟件比較全面的幫助文檔。
FAQ:http://www.isc.org/index.pl/sw/bind/ 回答了該軟件的常見問題。
配置文件樣例:http://www.bind.com/bind.html 一些比較標(biāo)準(zhǔn)的配置文件樣例。
三.、軟件的安裝。
1.安裝
由其官方網(wǎng)站中下載其源碼軟件包bind-9.3.1. tar.gz。接下來我將對(duì)安裝過程的一些重要步驟,給出其解釋:
[root@localhost root]#tar xzvf bind-9.3.1. tar.gz
[root@localhost root]#cd bind-9.3.1
[root@localhost bind-9.3.1]#./configure
[root@localhost bind-9.3.1]#make
[root@localhost bind-9.3.1]#make install
tar xzvf bind-9.3.1.tar.gz 解壓縮軟件包。
./configure 針對(duì)機(jī)器作安裝的檢查和設(shè)置,大部分的工作是由機(jī)器自動(dòng)完成的,但是用戶可以通過一些參數(shù)來完成一定的設(shè)置,其常用選項(xiàng)有:
./configure --help 察看參數(shù)設(shè)置幫助。
--prefix= 指定軟件安裝目錄(默認(rèn)/usr/local/)。
--enable-ipv6 支持ipv6。
可以設(shè)置的參數(shù)很多,可以通過 -help察看需要的,一般情況下,默認(rèn)設(shè)置就可以了。
默認(rèn)情況下,安裝過程是不會(huì)建立配置文件和一些默認(rèn)的域名解析的,不過并不妨礙,可以從下載一些標(biāo)準(zhǔn)的配置文件(http://www.bind.com/bind.html),也可以使用本文所提供的樣例文件。
默認(rèn)情況下,安裝的deamon為/usr/local/sbin/named
默認(rèn)的主配置文件,/etc/named.conf(須手動(dòng)建立)。
2.啟動(dòng):
[root@localhost root]# /usr/local/sbin/named -g
/usr/local/sbin/named默認(rèn)情況是一個(gè)后臺(tái)deamon ,-g選項(xiàng)表示前臺(tái)運(yùn)行,并將調(diào)試信息打印到標(biāo)準(zhǔn)輸出,這在我們安裝調(diào)試階段是非常有幫助的。
如果建立了配置文件和域名解析文件(關(guān)于怎樣建立將在下面的部分講到),ps aux 應(yīng)該可以查到named 的進(jìn)程,或netstat -an 也可以看到53端口的服務(wù)已經(jīng)起來了。(DNS默認(rèn)端口為53)
如果要設(shè)置開機(jī)自啟動(dòng)DNS server,只需在/etc/rc.d/rc.local中加入一行
/usr/local/sbin/named
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
/usr/local/sbin/named
四.軟件的配置。
1.主配置文件
默認(rèn)安裝主配置文件的位置為
/etc/named.conf
下面逐步分析一個(gè)比較基礎(chǔ)的配置文件:(注:named配置文件采用和c語言相同的注釋符號(hào))。
(1) log options
/*
 * log option
 */
logging {
    channel default_syslog { syslog local2; severity error; };
    channel audit_log { file "/var/log/named.log"; severity error; print-time yes; };
    category default { default_syslog; };
    category general { default_syslog; };
    category security { audit_log; default_syslog; };
    category config { default_syslog; };
    category resolver { audit_log; };
    category xfer-in { audit_log; };
    category xfer-out { audit_log; };
    category notify { audit_log; };
    category client { audit_log; };
    category network { audit_log; };
    category update { audit_log; };
    category queries { audit_log; };
    category lame-servers { audit_log; };
};
這一部分是日志的設(shè)置,其中最主要的是
file "/var/log/named.log" 這一句指定了日志文件的位置,要正常啟動(dòng)named,必須要保證這一文件是存在的,并且named 進(jìn)程對(duì)它有讀寫權(quán)限。
(2) options
options {
    directory "/etc/namedb";
    listen-on-v6 { any; };
// 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 {
        your.upper.DNS.address;
    };
    /*
     * 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;
    /*
     * If running in a sandbox, you may have to specify a different
     * location for the dumpfile.
     */
    dump-file "/etc/named_dump.db";
};
這一部分是一些基本的配置項(xiàng):
directory "/etc/namedb"; 指定域名解析等文件的存放目錄(須手動(dòng)建立);
listen-on-v6 { any; }; 支持ipv6的請求;
forwarders {
your.upper.DNS.address;
}; 指定前向DNS,當(dāng)本機(jī)無法解析的域名,就會(huì)被轉(zhuǎn)發(fā)至前向DNS進(jìn)行解析。
dump-file "/etc/named_dump.db"; 指定named_dump.db文件的位置。
(3) 線索域和回環(huán)域
// Setting up secondaries is way easier and the rough picture for this
// is explained below.
//
// If you enable a local name server, don't forget to enter 127.0.0.1
// into your /etc/resolv.conf so this server will be queried first.
// Also, make sure to enable it in /etc/rc.conf.
zone "." {
    type hint;
    file "named.root";
};
zone "0.0.127.IN-ADDR.ARPA" {
    type master;
    file "localhost.rev";
};
指定線索域和本地回環(huán)域,這一部分使用一些標(biāo)準(zhǔn)的例子就可以。
file "named.root"; 指定該域的解析文件,其目錄為options中directory "/etc/namedb";指定的。在本例中為/etc/namdb。

dig命令直接生成named.root文件
[root@linux named]#dig > named.root

(4)自定義域
zone "test.com" {
    type    master;
    file    "zone.test ";
};
zone "0.168.192.in-addr.arpa" {
    type    master;
    file    "zone. test.rev";
};
zone "4.0.0.f.0.5.2.0.1.0.0.2.IP6.ARPA" {    
    type master;
    allow-transfer { any;};
        allow-query { any; };        
    file "ipv6.rev";
};
zone "lowerlevelzone.test.com" {
    type    slave;
        masters {
        192.168.1.1;
    };
};
這一部分是配置文件中我們需要重點(diǎn)關(guān)心的部分:
zone "test.com" {
type master;
file "zone.test ";
}; 設(shè)定test.com域;
type master 指明該域主要由本機(jī)解析;
file "zone.test "指定其解析文件為zong.test,目錄為options中設(shè)定的目錄本例中為/etc/named。
zone "0.168.192.in-addr.arpa" {
type master;
file "zone. test.rev";
}; 指定ipv4地址逆向解析
type master 指明該域主要由本機(jī)解析;
file "zone.test.rev "指定其解析文件為zong.test.rev,目錄為options中設(shè)定的目錄本例中為/etc/named。
zone "4.0.0.f.0.5.2.0.1.0.0.2.IP6.ARPA" {
type master;
allow-transfer { any;};
allow-query { any; };
file "ipv6.rev";
};指定ipv4地址逆向解析
type master 指明該域主要由本機(jī)解析;
file " ipv6.rev "指定其解析文件為ipv6.rev,目錄為options中設(shè)定的目錄本例中為/etc/named。
zone "lowerlevelzone.test.com" {
type slave;
masters {
192.168.1.1;
};
}; 設(shè)定lowerlevelzone.test.com域;
type slave 指明該域主要由低一級(jí)的域名服務(wù)器解析;
masters {
192.168.1.1;
}; 指定低一級(jí)的域名服務(wù)器ip地址。
到此我們就初步建立了一個(gè)標(biāo)準(zhǔn)的named 的主配置文件,接下來建立對(duì)應(yīng)的域名解析或逆向解析文件。
2.域名解析和IP地址逆向解析文件:
(1) 域名解析:
/etc/namedb/zone.test

;    From: @(#)localhost.rev    5.1 (Berkeley) 6/30/90
; $FreeBSD: src/etc/namedb/PROTO.localhost.rev,v 1.6 2000/01/10 15:31:40 peter Exp $
;
; This file is automatically edited by the `make-localhost' script in
; the /etc/namedb directory.
;
@    IN    SOA    ns.test.com. root.test.com.(
                2005030116; Serial
                3600    ; Refresh
                900    ; Retry
                3600000    ; Expire
                3600 )    ; Minimum
    IN    NS    ns.test.com
;
ns        IN    A    192.168.0.1
www6    IN    AAAA    2001:250:f004::10
www    IN    A    192.168.0.2
本文件前半部分是一些默認(rèn)的參數(shù)設(shè)置,只需把域名改成對(duì)應(yīng)得你要設(shè)置的域就行,其余的不用過分深究,如果讀者有興趣可以查閱相關(guān)的手冊文檔。
(注意,
IN NS ns.test.com;
這一條必須有,來指定本域的域名服務(wù)器 ;
域名必須以"."結(jié)尾。)
本文件的第二部分(倒數(shù)三行),指定了該域上的主機(jī):
ns IN A 192.168.0.1
ns 為主機(jī)名,A 代表地址類型為IPV4地址,192.168.0.1 是實(shí)際ip地址,這一條記錄的含義是ns.test.com 的ip地址為 192.168.0.1
www6 IN AAAA 2001:250:f004::10
www6 為主機(jī)名,AAAA代表地址類型為IPV6地址,2001:250:f004::10 是其IPV6地址,這條記錄的含義是www6.test.com 的ip地址是2001:250:f004::10 。
(2)IP地址逆向解析:
ipv4 逆向解析:
/etc/namedb/zone.test.rev
;    From: @(#)localhost.rev    5.1 (Berkeley) 6/30/90
; $FreeBSD: src/etc/namedb/PROTO.localhost.rev,v 1.6 2000/01/10 15:31:40 peter Exp $
;
; This file is automatically edited by the `make-localhost' script in
; the /etc/namedb directory.
;
@    IN    SOA    ns.test.com. root.test.com.(
                2005030116; Serial
                3600    ; Refresh
                900    ; Retry
                3600000    ; Expire
                3600 )    ; Minimum
    IN    NS    ns.test.com
;
1    IN    PTR        ns.test.com.
2    IN    PTR        www.test.com.
ipv6 逆向解析:
/etc/namedb/zone.test.rev
;    From: @(#)localhost.rev    5.1 (Berkeley) 6/30/90
; $FreeBSD: src/etc/namedb/PROTO.localhost.rev,v 1.6 2000/01/10 15:31:40 peter Exp $
;
; This file is automatically edited by the `make-localhost' script in
; the /etc/namedb directory.
;
@    IN    SOA    ns.test.com. root.test.com.(
                2005030116; Serial
                3600    ; Refresh
                900    ; Retry
                3600000    ; Expire
                3600 )    ; Minimum
    IN    NS    ns.test.com
;
10.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0        IN    www6.test.com.
這里
10.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 IN www6.test.com.
與主配置文件/etc/named.conf中的
zone "4.0.0.f.0.5.2.0.1.0.0.2.IP6.ARPA"
"10.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0" + "4.0.0.f.0.5.2.0.1.0.0.2" 剛好組成點(diǎn)分的32位16進(jìn)制逆序ipv6地址。
實(shí)際上,ip地址逆向解析由于缺乏統(tǒng)一的管理和相關(guān)的標(biāo)準(zhǔn),這項(xiàng)服務(wù)的使用比較混亂,可以考慮不啟動(dòng)該服務(wù)。所以在這里只給出兩個(gè)例子,就不過多解釋了。
五.安裝使用的一些經(jīng)驗(yàn):
1.帶調(diào)試信息的啟動(dòng)
named -g
/usr/local/sbin/named默認(rèn)情況是一個(gè)后臺(tái)deamon ,-g選項(xiàng)表示前臺(tái)運(yùn)行,并將調(diào)試信息打印到標(biāo)準(zhǔn)輸出,這在我們安裝調(diào)試階段是非常有幫助的。
2.客戶端命令nslookup簡介
windows ,linux 平臺(tái)均支持此調(diào)試命令。
鍵入nslookup即進(jìn)入與服務(wù)器交互狀態(tài),這時(shí)鍵入域名或ip地址就可以向服務(wù)器正向或逆向查詢。
>www.test.com 正向域名解析
>192.168.0.1 逆向IP解析
>set type=AAAA 設(shè)置查詢地址類型為IPv6地址類型。
>set type=A 設(shè)置查詢地址類型為IPv4地址類型。
>exit 退出。
參考資料:
[1]:http://www.bind.com/
[2]:http://www.isc.org/index.pl?/sw/bind/
[3]:ipv6.bupt.edu.cn 
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
BIND
[原創(chuàng)] 架設(shè)dns全攻略
DNS服務(wù)及基于BIND的實(shí)現(xiàn)
centos5.5 DNS詳細(xì)配置說明 1
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服