
独自の DNS サーバー ns1.myhostingdomain.com と ns2.myhostingdomain.com をセットアップしたいと思います。
使用するサーバーが 2 つあり、1 つはプライマリ サーバー、もう 1 つはスレーブ サーバーです。目標は、Web ホスティング セットアップ用に設定することです。新しいドメイン (ゾーン) を追加し、新しく購入した (ホストされた) ドメインを ns1.myhostingdomain.com と ns2.myhostingdomain.com にポイントできるようにしたいと考えています。
まずスレーブを追加せずにプライマリから始めて、プライマリが機能したらスレーブを機能させようと考えました。私は ubuntu 9.10 (karmic) に bind9 をインストールしました。
部分的に構成されていると思います。これまでに次の操作を実行しました:
変更: /etc/bind/named.conf.options - フォワーダーを ns1.myhostingdomain.com サーバーの上にあるネーム サーバーに変更しました (ホスト名は実際には ns1 ではなく、poseidon.* です。これが問題になるかどうかはわかりません)
options {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
forwarders {
69.20.95.4;
65.61.188.4;
};
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
/etc/bind/named.conf.localにゾーンを追加しました
#start_zone myhostingdomain.com
zone "myhostingdomain.com" {
type master;
file "/etc/bind/zones/myhostingdomain.com.db";
};
次にゾーンファイル /etc/bind/zones/myhostingdomain.com.db を作成しました
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA ns1.myhostingdomain.com. dnsadmin.myhostingdomain.com. (
20100809001 ; Serial
1H ; Refresh
15M ; Retry
4W ; Expire
1H ; Negative Cache TTL
)
;
@ IN NS ns1.myhostingdomain.com.
@ IN NS ns2.myhostingdomain.com.
@ IN A 184.106.207.45
ns1 IN A 184.106.207.45
ns2 IN A 184.106.229.136
何か見落としていることがあるのでしょうか、それとも完全に間違っているのでしょうか?
答え1
レジストラレベルでDNSサーバーにゾーンを指定していますか?Adig +trace ns1.myhostingdomain.com
からの出力に加えて、さらに詳しい情報が得られるはずです。cat /etc/resolv.conf
答え2
bind を再起動し、syslog でエラーを確認すれば完了です。
システムをセキュリティ保護するための手順として、再帰を自分のアドレス空間のみに制限する必要があります。
options {
...
// uncomment this section to limit recursion to internal hosts
allow-recursion {
localhost;
10.0.0.0/8;
172.16.0.0/12;
192.168.0.0/16;
};
...
};