- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- ソース を表示
- BIND/BIND9インストール(FreeBSD) へ行く。
- 1 (2007-07-14 (土) 14:37:28)
- 2 (2007-07-15 (日) 16:24:46)
BIND9インストール(FreeBSD)
概要
FreeBSD6.2にBIND9をインストールする。なお、chrootはしない。
インストール
portsで。
cd /usr/ports/dns/bind9 make install
rndcの設定
BIND9の起動などはrndcコマンドを用いる。
鍵の作成
rndc-confgen -a chown bind /etc/namedb/rndc.key
rndc.keyが出来たが、DNSサーバはユーザbindで実行する予定なので、オーナーを変更しておく。
rndc.confの編集 (/etc/namedb/rndc.conf)
options {
default-server localhost;
default-key "key";
};
server localhost {
key "key";
};
key "key" {
algorithm hmac-md5;
secret "ABCDEFG12345;
};
↑「key "key" {}」の部分はrndc.keyのそれをそのままコピーする。
namedの設定
named.confの編集(/var/named/etc/namedb/named.conf)
options {
directory "/etc/namedb";
pid-file "/var/run/named/pid";
dump-file "/var/dump/named_dump.db";
statistics-file "/var/stats/named.stats";
forwarders {
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.zone";
};
example.netゾーン(/var/named/etc/namedb/master/example.net.zone)
$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)
$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.
起動
named -u bind -c /etc/namedb/named.conf