[ITPASS2020]2020年度(5月)bindアップグレードログ(ika)

ika-itpass の bind アップグレード作業ログ

経緯

作業概要

  • bind9 をアップグレードする
  • 作業日
    • 2020/05/22
  • 作業者
    • 高橋

作業ログ

現状の確認

bind が動作していることを確認する.

$ ps aux | grep bind
root       545  0.0  0.0  49868  2556 ?        Ss    2019   0:12 /sbin/rpcbind -f -w
bind       728  0.0  0.2 778708 43696 ?        Ssl   2019  39:05 /usr/local/bind/sbin/named -f -u bind -c /usr/local/bind/etc/namedb/named.conf
yot       4883  0.0  0.0  13232   928 pts/0    S+   15:07   0:00 grep bind

インストールされている bind のバージョンを確認する.

$ /usr/local/bind/sbin/named -v
BIND 9.14.1 (Stable Release) <id:d4c1008>

名前解決の確認. (www.google.com の IP アドレスを調べる.)

$ dig @133.30.109.22 www.google.com

; <<>> DiG 9.14.1 <<>> @133.30.109.22 www.google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19595
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 4f0049f944fc3364c2d307575ec76cd354054dea0a717f5d (good)
;; QUESTION SECTION:
;www.google.com.                        IN      A

;; ANSWER SECTION:
www.google.com.         84      IN      A       216.58.197.4

;; Query time: 0 msec
;; SERVER: 133.30.109.22#53(133.30.109.22)
;; WHEN: 金  5月 22 15:10:27 JST 2020
;; MSG SIZE  rcvd: 87

新バージョンのビルド

  • 配布サイト <URL:https://www.isc.org/> からソースのアーカイブを 取得し, ビルドする.
    • ビルドは /usr/local/src で行う.
    • インストール先は /usr/local/bind とする.

      $ sudo -s
      # cd /usr/local/src
    • 2020 年 5 月 22 日現在の "Current-Stable" のバージョン (9.16.3) を取得した.

      # wget https://downloads.isc.org/isc/bind9/9.16.3/bind-9.16.3.tar.xz
      # tar xvf bind-9.16.3.tar.xz
      # cd bind-9.16.3
      # ./configure --prefix=/usr/local/bind

      "configure: error: libuv not found" と言われて configure が停止した.

      libuv とは,

      libuv is a multi-platform support library with a focus on asynchronous I/O.

      らしい.

      debian パッケージをインストール.

      # apt-cache search libuv

      でパッケージを調べて

      # apt-get install libuv1

      でインストール. しかしこれでも configure でエラーが出るので追加.

      # apt-get install libuv1-dev

      configure のエラーが変わって

      configure: error: sys/capability.h header is required for Linux capabilities support. Either install libcap or use --disable-linux-caps.

      と言われたので, libcap とやらをインストール.

      # apt-cache search libcap

      でパッケージを調べて

      # apt-get install libcap-dev

      でインストール (libcap2 は既にインストールされていた).

      もう一度 configure

      # ./configure --prefix=/usr/local/bind

      成功.

      # make

      成功.

新バージョンのインストール

現在動いている bind の停止.

まず確認.

# systemctl status bind9
● bind9.service - BIND Domain Name Server
   Loaded: loaded (/etc/systemd/system/bind9.service; enabled; vendor preset: en
   Active: active (running) since Wed 2019-12-04 11:14:05 JST; 5 months 17 days
     Docs: man:named(8)
 Main PID: 728 (named)
    Tasks: 18 (limit: 4915)
     CGroup: /system.slice/bind9.service
           mq728 /usr/local/bind/sbin/named -f -u bind -c /usr/local/bind/etc/na

停止.

# systemctl stop bind9

確認.

# systemctl status bind9
● bind9.service - BIND Domain Name Server
   Loaded: loaded (/etc/systemd/system/bind9.service; enabled; vendor preset: en
   Active: inactive (dead) since Fri 2020-05-22 15:30:59 JST; 1s ago
     Docs: man:named(8)
  Process: 24148 ExecStop=/usr/local/bind/sbin/rndc stop (code=exited, status=0/
 Main PID: 728 (code=exited, status=0/SUCCESS)

 5月 22 15:30:59 ika-itpass systemd[1]: Stopping BIND Domain Name Server...
 5月 22 15:30:59 ika-itpass rndc[24148]: WARNING: key file (/usr/local/bind/etc/r
 5月 22 15:30:59 ika-itpass systemd[1]: Stopped BIND Domain Name Server.

新バージョンのインストール

インストール.

# make install

成功.

新バージョンの動作確認

バージョン確認.

# /usr/local/bind/sbin/named -v
BIND 9.16.3 (Stable Release) <id:5ea41c1>

bind 起動

# systemctl start bind9

確認

# systemctl status bind9
● bind9.service - BIND Domain Name Server
   Loaded: loaded (/etc/systemd/system/bind9.service; enabled; vendor preset: en
   Active: active (running) since Fri 2020-05-22 15:32:30 JST; 17s ago
     Docs: man:named(8)
  Process: 24148 ExecStop=/usr/local/bind/sbin/rndc stop (code=exited, status=0/
 Main PID: 26333 (named)
    Tasks: 26 (limit: 4915)
   CGroup: /system.slice/bind9.service
           mq26333 /usr/local/bind/sbin/named -f -u bind -c /usr/local/bind/etc/

 5月 22 15:32:30 ika-itpass named[26333]: automatic empty zone: D.F.IP6.ARPA
 5月 22 15:32:30 ika-itpass named[26333]: automatic empty zone: 8.E.F.IP6.ARPA
 5月 22 15:32:30 ika-itpass named[26333]: automatic empty zone: 9.E.F.IP6.ARPA
 5月 22 15:32:30 ika-itpass named[26333]: automatic empty zone: A.E.F.IP6.ARPA
 5月 22 15:32:30 ika-itpass named[26333]: automatic empty zone: B.E.F.IP6.ARPA
 5月 22 15:32:30 ika-itpass named[26333]: automatic empty zone: 8.B.D.0.1.0.0.2.I
 5月 22 15:32:30 ika-itpass named[26333]: automatic empty zone: EMPTY.AS112.ARPA
 5月 22 15:32:30 ika-itpass named[26333]: automatic empty zone: HOME.ARPA
 5月 22 15:32:30 ika-itpass named[26333]: none:98: 'max-cache-size 90%' - setting
 5月 22 15:32:30 ika-itpass named[26333]: command channel listening on 127.0.0.1#
# exit

名前解決の確認.

$ dig @133.30.109.22 www.google.com

; <<>> DiG 9.16.3 <<>> @133.30.109.22 www.google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40136
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: dcd21b33fac5b0e9010000005ec77264e5e55cc44d83f5b0 (good)
;; QUESTION SECTION:
;www.google.com.                        IN      A

;; ANSWER SECTION:
www.google.com.         296     IN      A       216.58.197.4

;; Query time: 0 msec
;; SERVER: 133.30.109.22#53(133.30.109.22)
;; WHEN: 金  5月 22 15:34:12 JST 2020
;; MSG SIZE  rcvd: 87

終了.