Bindさま本家 http://www.isc.org/software/bind
最新版のリリース情報は右サイトより得られる https://lists.isc.org/pipermail/bind-announce/

DNS(Domain Name System)を稼働させるプログラムの一つがISC BINDである。
ここではCentOS 7にて、このbindのインストールを書き記す。
*samba-4.xのActiveDirectoryドメインコントローラ機能と連携して使用することができる。詳しくはsamba42にて

構築環境の整備

CentOSを参考にCentOS 7稼働の素体を用意する。
これに開発環境とbindの稼働に必要なツールをインストールする。
*net-toolsにはifconfigらが入っている

[root@c ~]# yum groupinstall development
[root@c ~]# yum install openssl-devel wget net-tools

また、bindは特定のユーザにて稼働させたいので、そのユーザのアカウント(named)を用意する。

[root@c ~]# groupadd -r named
[root@c ~]# useradd  -r -d /var/named -s /sbin/nologin -g named -c "ISC BIND"  named

構築

次に、bindを取得してコンパイル及びインストールを行います。

[root@c ~]# mkdir -p /opt/src && cd /opt/src
[root@c src]# wget ftp://ftp.riken.jp/net/bind/9.9.6-P2/bind-9.9.6-P2.tar.gz
[root@c src]# gzip -cd bind-9.9.6-P2.tar.gz | tar xf -
[root@c src]# chown -R root:root ./bind-9.9.6-P2
[root@c src]# cd bind-9.9.6-P2
[root@c bind-9.9.6-P2]# ./configure --prefix=/opt/bind996P2 --with-gssapi --with-dlopen=yes \
    --disable-ipv6 --disable-chroot | tee make.log
(中略)
========================================================================
Configuration summary:
------------------------------------------------------------------------
Optional features enabled:
    GSS-API (--with-gssapi)
    Print backtrace on crash (--enable-backtrace)
    Use symbol table for backtrace, named only (--enable-symtable)
    Dynamically loadable zone (DLZ) drivers:
        None
 
Features disabled or unavailable on this platform:
    Multiprocessing support (--enable-threads)
    IPv6 support (--enable-ipv6)
    Response Rate Limiting (--enable-rrl)
    PKCS#11/Cryptoki support (--with-pkcs11)
    New statistics (--enable-newstats)
    Allow 'fixed' rrset-order (--enable-fixed-rrset)
    Automated Testing Framework (--with-atf)
    GOST algorithm support (--with-gost)
========================================================================
[root@c bind-9.9.6-P2]#
[root@c bind-9.9.6-P2]# make | tee -a make.log
[root@c bind-9.9.6-P2]# ./bin/tests/system/ifconfig.sh up  *内部でifconfigが呼ばれる
[root@c bind-9.9.6-P2]# make check | tee -a make.log
(中略)
E:zonechecks:2015年  3月  8日 日曜日 11:48:25 JST
I:System test result summary:
I:      54 PASS
I:       1 PKCS11ONLY
I:       4 SKIPPED
I:       6 UNTESTED
(中略)
[root@c bind-9.9.6-P2]#
[root@c bind-9.9.6-P2]# ./bin/tests/system/ifconfig.sh down
[root@c bind-9.9.6-P2]# make install | tee -a make.log
[root@c bind-9.9.6-P2]# ( cd /opt; rm -f bind ; ln -s bind996P2 bind )
[root@c bind-9.9.6-P2]# /opt/bind/sbin/rndc-confgen -a
wrote key file "/opt/bind996P2/etc/rndc.key"
[root@c bind-9.9.6-P2]#
[root@c bind-9.9.6-P2]# chown named:named /opt/bind/etc/rndc.key
[root@c bind-9.9.6-P2]# chown -R named:named /opt/bind/var/run
[root@c bind-9.9.6-P2]# cd /var/named

CentOS 7では起動スクリプトが異なる。bind/bind設定にsystemd向けのUnitを用意した。これを/etc/systemd/systemに配置して、systemdに読み込ませ、起動させる。

[root@c ~]# vi /etc/systemd/system/named.service
 
[root@c ~]# systemctl daemon-reload
[root@c ~]# systemctl enable named.service
[root@c ~]# systemctl start named.service

今後は、OS由来のbindを使わないようにする為に、yum.confを調整します。

[root@c ~]# vi /etc/yum.conf
exclude=bind*
[root@c ~]#

これで、bind関係のパッケージはインストール/アップデートされなくなる。
しかし他のパッケージのインストールの際、bind関係が依存されているとエラーが表示される。
*bind-utilsとsssdが依存関係にあるので、sssdをインストール/アップデートする際は注意が必要

設定ファイルの用意

bind/bind設定参照

リンク作成

ここでは/opt/bindをprefixとして定義している。だが、samba4とかではrndcを/usr/sbin/rndcと決め打ちで使用している個所があるので、yumで本来インストールされるbindの各種プログラムがあたかもそこにあるようにリンクを設けておく。
まずは/usr/binにおいて、

[root@c ~]# cd /usr/bin
[root@c bin]# ln -sv /opt/bind/bin/* .
`./bind9-config' -> `/opt/bind/bin/bind9-config'
`./dig' -> `/opt/bind/bin/dig'
`./host' -> `/opt/bind/bin/host'
`./isc-config.sh' -> `/opt/bind/bin/isc-config.sh'
`./nslookup' -> `/opt/bind/bin/nslookup'
`./nsupdate' -> `/opt/bind/bin/nsupdate'
[root@c bin]#

として、リンクを作成。次に/usr/sbinにおいては、

[root@c ~]# cd /usr/sbin/
[root@c sbin]# ln -sv /opt/bind/sbin/* .
`./arpaname' -> `/opt/bind/sbin/arpaname'
`./ddns-confgen' -> `/opt/bind/sbin/ddns-confgen'
`./dnssec-dsfromkey' -> `/opt/bind/sbin/dnssec-dsfromkey'
`./dnssec-importkey' -> `/opt/bind/sbin/dnssec-importkey'
`./dnssec-keyfromlabel' -> `/opt/bind/sbin/dnssec-keyfromlabel'
`./dnssec-keygen' -> `/opt/bind/sbin/dnssec-keygen'
`./dnssec-revoke' -> `/opt/bind/sbin/dnssec-revoke'
`./dnssec-settime' -> `/opt/bind/sbin/dnssec-settime'
`./dnssec-signzone' -> `/opt/bind/sbin/dnssec-signzone'
`./dnssec-verify' -> `/opt/bind/sbin/dnssec-verify'
`./genrandom' -> `/opt/bind/sbin/genrandom'
`./isc-hmac-fixup' -> `/opt/bind/sbin/isc-hmac-fixup'
`./lwresd' -> `/opt/bind/sbin/lwresd'
`./named' -> `/opt/bind/sbin/named'
`./named-checkconf' -> `/opt/bind/sbin/named-checkconf'
`./named-checkzone' -> `/opt/bind/sbin/named-checkzone'
`./named-compilezone' -> `/opt/bind/sbin/named-compilezone'
`./named-journalprint' -> `/opt/bind/sbin/named-journalprint'
`./nsec3hash' -> `/opt/bind/sbin/nsec3hash'
`./rndc' -> `/opt/bind/sbin/rndc'
`./rndc-confgen' -> `/opt/bind/sbin/rndc-confgen'
[root@c sbin]#

としておく。各自のユーザには/usr/binのパスが既にあるから特段不要なのであるが、/etc/profile.dでのPATH環境変数の定義を下記に示す。
bash向けとして、

[root@c ~]# vi /etc/profile.d/bind.sh
# bind initialization script (csh)
if ! echo ${PATH} | /bin/grep -q /opt/bind/bin ; then
        PATH=/opt/bind/bin:${PATH}
fi
[root@c ~]#

csh系向けとして、

[root@c ~]# vi /etc/profile.d/bind.csh
# bind initialization script (csh)
 
if ( "${path}" !~ */opt/bind/bin* ) then
        set path = ( /opt/bind/bin $path )
endif
[root@c ~]#

と定義しておく。

最新の60件
2026-01-18 2026-01-17 2026-01-16 2026-01-12 2026-01-11 2026-01-10 2026-01-09 2026-01-08 2026-01-06 2026-01-04 2026-01-01 2025-12-31 2025-12-28 2025-12-27 2025-12-12 2025-12-11 2025-12-09 2025-12-08 2025-12-07 2025-12-05 2025-11-30 2025-11-27 2025-11-24 2025-11-23 2025-11-18 2025-11-16 2025-11-05 2025-11-03 2025-11-02 2025-10-30 2025-10-29 2025-10-28 2025-10-26 2025-10-25 2025-10-24 2025-10-22 2025-10-21 2025-10-17 2025-10-13 2025-10-11 2025-10-06 2025-10-05

edit


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2015-03-08 (日) 13:04:11