• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 使用bind9 的rndc 控制dns

    發表于:2007-05-25來源:作者:點擊數: 標簽:
    :em02::em02::em02::em02: 首先在這里感謝:阿驍,yfhe,網中人版主的幫忙.. 使用bind9的rndc控制dns 在bind8是由ndc控制dns,最近由于傳出bind8有漏洞所以偶把deinstall,升 到9.0.而9.0是由rndc來控制dns從新加載配置文件等等,下面就把小弟的配置文 檔寫出來.由

    :em02:  :em02:  :em02:  :em02: 

    首先在這里感謝:阿驍,yfhe, 網中人 版主的幫忙..


    使用bind9 的rndc 控制dns 

    在bind8 是由ndc控制dns ,最近由于傳出bind8有漏洞 所以偶把deinstall, 升

    到9.0 .而9.0是由rndc 來控制dns從新加載配置文件等等,下面就把小弟的配置文

    檔寫出來.由于是菜鳥,哪地方不足還請高手請點!!!


    本例中.Freebsd4.9+bind8+hcpost.com 域名 待升到bind9.2.3


    首先我下載了一個最新的bind9.2.3.tar.gz.到/home/里


    freebsd# tar zxvf bind9.2.3.tar.gz -C /usr/local

    freebsd# cd bind9.2.3

    freebsd# ./configure   ---->我沒有prefix= 裝的,默認啟動文件在/usr/local/sbin里


    freebsd# make

    freebsd# make install

    到此,bind9 已經安裝完成.看一看版本現版本是多少.


    freebsd# /usr/local/sbin/named -v

    BIND 9.2.3


    我的named.conf 配置文檔在/etc/namedb 文件里. bind9 規定,如果要使用

    rndc 來控制dns

    必須先生成驗證文件.rndc.conf 和密鎖.


    ****注:這部最重要了.


    freebsd# /usr/local/sbin/rndc-confgen > /etc/rndc.conf 生成這個文件按你--prefix 而定.

    (freebsd# /usr/local/sbin/named -g
    Jan 11 11:56:45.075 starting BIND 9.2.3 -g
    Jan 11 11:56:45.076 using 1 CPU
    Jan 11 11:56:45.079 loading configuration from '/etc/named.conf'
     
    用這一條確定.你應該把/rndc.conf 生成到目錄下.)

    注:好象freebsd 要生成rndc.conf 文件.必須在/etc/rc.conf 加這一條,要不然.運行rndc-confgen屏目就一直不動了.解決方法是在/etc/rc.conf 加入

    rand_irqs="3 14 15"

    然后,

    freebsd# /etc.netstart 從新加載rc.conf 文件,如果netstart不行.就reboot

    生成的rndc.conf 大至如下.

    freebsd# /usr/local/sbin/rndc-confgen
    # Start of rndc.conf
    key "rndc-key" {
            algorithm hmac-md5;
            secret "Cm9Lc0JG5wJcsoRj3PbKqw==";
    };

    options {
            default-key "rndc-key";
            default-server 127.0.0.1;
            default-port 953;
    };
    # End of rndc.conf

    # Use with the following in named.conf, adjusting the allow list as needed:
    # key "rndc-key" {
    #       algorithm hmac-md5;
    #       secret "Cm9Lc0JG5wJcsoRj3PbKqw==";
    # };
    #
    # controls {
    #       inet 127.0.0.1 port 953
    #               allow { 127.0.0.1; } keys { "rndc-key"; };
    # };
    # End of named.conf


    打開剛在/etc/rndc.conf 文件.打# Use with the following in named.conf, adjusting the allow list as needed:
    這行下的所有復制到

    你的named.conf 文件里

    偶的是.

    freebsd# cat /etc/namedb/named.conf
    options {
            directory "/etc/namedb";
            notify  yes;
            allow-transfer  { 218.24.233.11; };---->>這個是只轉發到我輔dns 上.
    };

    # Use with the following in named.conf, adjusting the allow list as needed:
     key "rndc-key" {
           algorithm hmac-md5;
           secret "5hhmFj6S3Pn6EoDnOvlblg==";
     };

     controls {
           inet 127.0.0.1 port 953
                   allow { 127.0.0.1; } keys { "rndc-key"; };
     };
    # End of named.conf

    zone "." {
            type hint;
            file "named.root";
    };

    zone "0.0.127.IN-ADDR.ARPA" {
            type master;
            file "localhost.rev";
    };


    zone "hcpost.com" {
            type master;
            file "/etc/namedb/hosts/hcpost.com.hosts";
    };

    zone "233.24.218.in-addr.arpa" {
            type master;
            file "/etc/namedb/rev/218.24.233.rev";
    };



    完成,最后啟動bind9 . 

    freebsd# /usr/local/sbin/named -c /etc/namedb/named.conf

    測試rndc是否成功


    freebsd# rndc status
    number of zones: 5
    debug level: 0
    xfers running: 0
    xfers deferred: 0
    soa queries in progress: 0
    query logging is OFF
    server is up and running

    出現如下.代表rndc 已經成功控制bind9 


    如果想啟動就加載.

    可以在/usr/local/etc/rc.d/ 寫一個.sh 腳本文件,小弟就簡單了.


    vi /usr/local/etc/rc.d/startbind.sh
    加入
    #!/bin/sh
    /usr/local/sbin/named -c /etc/namedb/named.conf


    呵呵,就這么簡單.

    【發表回復】【查看CU論壇原帖】【添加到收藏夾】【javascript:window.close()">關閉】
     網中人 回復于:2004-01-11 23:17:23
    感謝分享﹗ 鼓勵原創﹗

     liuyanbo 回復于:2004-01-12 08:50:04
    rc.conf 是rndc.conf吧 疑惑

     清茶淡淡 回復于:2004-01-12 12:10:34
    美文~ 收藏之

     小灰狼 回復于:2004-01-12 12:13:54
    to:liuyanbo     rc.conf 是rndc.conf吧

    rc.conf    freebsd下的/etc/rc.conf 下的配置文件

    請看: rndc-confgen 一直停時.需要在/etc/rc.conf 加這行參數. 

    Q: I have Freebsd 4.4 and "rndc-confgen -a" just sits there.

    A: /dev/random is not configured.  Use rndcontrol(8) to tell the kernel
    to use certain interrupts as a source of random events.  You can make this
    permanent by setting rand_irqs in /etc/rc.conf.

    e.g.
            /etc/rc.conf
            rand_irqs="3 14 15"

     yfhe 回復于:2004-01-12 14:21:41
    不錯,先收下了 :D

     liuyanbo 回復于:2004-01-12 19:48:01
    rndc.key如何生成?
    named.conf文件中 key "rndc-key" { 
           algorithm hmac-md5; 
           secret "5hhmFj6S3Pn6EoDnOvlblg=="; 
    和# /usr/local/sbin/rndc-confgen 
    # Start of rndc.conf 
    key "rndc-key" { 
            algorithm hmac-md5; 
            secret "Cm9Lc0JG5wJcsoRj3PbKqw=="; 
    }; 
    中的key值為什么不一樣?
    我應該先做:
    1./usr/local/sbin/rndc-confgen > /etc/rndc.conf
    2.  /usr/local/sbin/rndc-confgen 
    然后將2步生成的key值復制到named.conf文件中。
    我用的是solaris9,剛從linux轉型過來,請不吝賜教

     yj11 回復于:2004-01-14 10:44:17
    rndc dumpdb試過可以嗎?我在家里的試的總是不行 :(

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>