• 追加された行はこの色です。
  • 削除された行はこの色です。
* BIND9インストール(FreeBSD) [#i849de05]

** 概要 [#d350bcd5]
FreeBSD6.2にBIND9をインストールする。なお、chrootはしない。

** インストール [#l89f01f8]
portsで。
 cd /usr/ports/dns/bind9
 make install

** rndcの設定 [#t50d45c2]
BIND9の起動などはrndcコマンドを用いる。
*** 鍵の作成 [#z6769224]
 rndc-confgen -a
 chown bind /etc/namedb/rndc.key
rndc.keyが出来たが、DNSサーバはユーザbindで実行する予定なので、オーナーを変更しておく。


*** rndc.confの編集 [#xb3d7402]
/etc/namedb/rndc.conf:

*** rndc.confの編集 (/etc/namedb/rndc.conf)[#xb3d7402]
 options {        
        default-server  localhost;
        default-key     "key";
 };
 
 server localhost {
        key     "key";
 };
 
 key "key" {
        algorithm       hmac-md5;
        secret          "ABCDEFG12345;
 };

↑「key "key" {}」の部分はrndc.keyのそれをそのままコピーする。

** namedの設定 [#j5d10a03]
*** named.confの編集(/var/named/etc/namedb/named.conf) [#c32f2bbf]
 options {
        directory       "/etc/namedb";
        pid-file        "/var/run/named/pid";
        dump-file       "/var/dump/named_dump.db";
        statistics-file "/var/stats/named.stats";
 
        //listen-on     { 127.0.0.1; };
 
     //forward only;
 
 /*
        forwarders {
                127.0.0.1;
                192.168.0.100;
        };
 */
 };
 
 include "rndc.key";
 
 zone "." {
        type hint;
        file "named.root";
 };
 
 zone "0.0.127.IN-ADDR.ARPA" {
        type master;
        file "master/localhost.rev";
 };
 
 zone "example.net" {
        type master;
        file "master/example.net";
        file "master/example.net.zone";
 };
*** example.netゾーン(/var/named/etc/namedb/master/example.net.zone) [#z03e6e22]
 $TTL 86400
 @               IN SOA  ns.example.room. root.ns.example.room (
                                 2007071500              ; serial
                                      10800              ; refresh
                                       3600              ; retry
                                     604800              ; expiry
                                      86400 )            ; minimum
 
                         IN NS           ns.example.room.
                         IN MX   10      mail.example.room.
 ns                      IN A            192.168.1.10
 www                     IN A            192.168.1.20
 mail                    IN A            192.168.1.30

*** 127.0.0.1 ゾーン(/var/named/etc/namedb/master/localhost.rev) [#i920b98e]
 $TTL    604800
 @       IN      SOA     localhost. root.localhost. (
                               1         ; Serial
                          604800         ; Refresh
                           86400         ; Retry
                         2419200         ; Expire
                          604800 )       ; Negative Cache TTL
 ;
 @       IN      NS      localhost.
 1.0.0   IN      PTR     localhost.

** 起動 [#yae31f51]
 named -u bind -c /etc/namedb/named.conf



トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS