BIND : インストール / 設定2018/05/08 |
|
ドメイン名 と IP アドレス の名前解決機能を提供する DNS (Domain Name System) サーバーを構築します。
なお、DNS は 53/TCP,UDP を使用します。
|
|
| [1] | BIND 9 をインストールします。 |
|
root@dlp:~# apt -y install bind9 bind9utils
|
| [2] | BIND 9 の設定です。 以下の設定は、グローバルアドレス [172.16.0.80/29], プライベートアドレス [10.0.0.0/24], ドメイン名 [srv.world] の場合の例です。 自身の環境に合わせて置き換えて設定してください。(172.16.0.80/29 は実際にはプライベート用のアドレスです) |
|
root@dlp:~#
include "/etc/bind/named.conf.options";vi /etc/bind/named.conf include "/etc/bind/named.conf.local"; # コメント化 # include "/etc/bind/named.conf.default-zones";# 追記
include "/etc/bind/named.conf.internal-zones";
include "/etc/bind/named.conf.external-zones";
root@dlp:~#
vi /etc/bind/named.conf.internal-zones # 新規作成 # 内部向けの定義を記述
view "internal" {
# 指定範囲内のホストが内部向けの定義を参照
match-clients {
localhost;
10.0.0.0/24;
};
# 内部向け正引き情報を定義
zone "srv.world" {
type master;
file "/etc/bind/srv.world.lan";
allow-update { none; };
};
# 内部向け逆引き情報を定義 *注
zone "0.0.10.in-addr.arpa" {
type master;
file "/etc/bind/0.0.10.db";
allow-update { none; };
};
include "/etc/bind/named.conf.default-zones";
};
root@dlp:~#
vi /etc/bind/named.conf.external-zones # 新規作成 # 外部向けの定義を記述
view "external" {
# 内部向け範囲以外のホストが参照
match-clients { any; };
# 問い合わせは全て許可
allow-query { any; };
# 再帰検索禁止
recursion no;
# 外部向け正引き情報を定義
zone "srv.world" {
type master;
file "/etc/bind/srv.world.wan";
allow-update { none; };
};
# 外部向け正引き情報を定義 *注
zone "0.16.172.in-addr.arpa" {
type master;
file "/etc/bind/0.16.172.db";
allow-update { none; };
};
};
# *.*.*.*.in-addr.arpa の箇所についてはネットワークアドレスを逆にしたものを入力する # 10.0.0.0/24 の場合 # ネットワークアドレス ⇒ 10.0.0.0 # ネットワークの範囲 ⇒ 10.0.0.0 - 10.0.0.255 # 指定方法 ⇒ 0.0.10.in-addr.arpa |
| [3] | 名前解決の問い合わせ等を許可する範囲等を限定しておきます。 |
|
root@dlp:~#
vi /etc/bind/named.conf.options
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 {
// 0.0.0.0;
// };
# 問い合わせを許可する範囲
allow-query { localhost; 10.0.0.0/24; };
# ゾーン情報の転送を許可する範囲 ( セカンダリDNSがいる場合はその場所/範囲 )
allow-transfer { localhost; 10.0.0.0/24; };
# 再帰検索を許可する範囲
allow-recursion { localhost; 10.0.0.0/24; };
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation auto;
auth-nxdomain no; # conform to RFC1035
# IPV6を利用しないならば変更
listen-on-v6 { none; };
};
|
| Sponsored Link |
|
|