目次
文書の過去の版を表示しています。
bind - DNSサーバー
パッケージインストール
$ sudo yum install bind bind-utils
サービス自動起動設定
$ sudo systemctl enable named.service
bind-chrootでchroot環境を構成する場合
パッケージインストール
$ sudo yum install bind-chroot
chroot環境を有効化
$ sudo /usr/libexec/setup-named-chroot.sh /var/named/chroot on
サービス自動起動設定
$ sudo systemctl enable named-chroot.service
サービス起動
$ sudo systemctl start named-chroot.service
bindの設定
設定ファイルのバックアップ
$ sudo cp /etc/named.conf /etc/named.conf.org
設定ファイルの修正
$ sudo vi /etc/named.conf
$ sudo diff /etc/named.conf.org /etc/named.conf 11,12c11,12 < listen-on port 53 { 127.0.0.1; }; < listen-on-v6 port 53 { ::1; }; --- > listen-on port 53 { 127.0.0.1; 192.168.1.10; }; > #listen-on-v6 port 53 { ::1; }; 17c17,23 < allow-query { localhost; }; --- > allow-query { localhost; 192.168.1.0/24; }; > > forward only; > forwarders { > 202.224.32.1; > 202.224.32.2; > }; 56a63,78 > > zone "fireball.local" IN { > type master; > file "fireball.local.zone"; > allow-update { > 192.168.1.0/24; > }; > }; > > zone "1.168.192.in-addr.arpa" IN { > type master; > file "1.168.192.in-addr.arpa.rev"; > allow-update { > 192.168.1.0/24; > }; > };
ゾーンの設定
正引きの設定
正引きファイルを新規作成。
$ sudo vi /var/named/fireball.local.zone
$TTL 86400 ; 1 day @ IN SOA blue-dc.fireball.local. root.blue-dc.fireball.local. ( 2013101001 ; serial 10800 ; refresh (3 hours) 3600 ; retry (1 hour) 604800 ; expire (1 week) 3600 ; minimum (1 hour) ) NS blue-dc.fireball.local. blue-dc A 192.168.1.10 blue-sv A 192.168.1.20 blue-sv1 A 192.168.1.21 blue-sv2 A 192.168.1.22
逆引きの設定
逆引きファイルを新規作成。
$ sudo vi /var/named/1.168.192.in-addr.arpa.rev
$TTL 86400 @ IN SOA blue-ns.fireball.local root.blue-ns.fireball.local. ( 2013101001 ; serial 3H ; refresh 1H ; retry 1W ; expire 1H ) ; minimum IN NS blue-ns.fireball.local. 10 IN PTR blue-ns.fireball.local. 20 IN PTR blue-sv.fireball.local. 21 IN PTR blue-sv1.fireball.local. 22 IN PTR blue-sv2.fireball.local.
firewallの設定
$ sudo firewall-cmd --permanent --add-service=dns $ sudo firewall-cmd --reload
サービス起動
$ sudo systemctl start named.service