0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Debian8 jessie のbind9でipv6を無効化

0
Last updated at Posted at 2016-12-18

ipv6を使わないので無効にしようと思い、幾つかサイトを見ると/etc/default/bind9OPTIONS="-f -u bind"-4 を追加してOPTIONS="-f -u bind -4"にする手順が書かれているが、そのように設定してもダメ。
要するに/etc/default/bind9が効かない。
こうやったらできた

  • /etc/systemd/system/bind9.serviceが無いことを確認。#既に有ればそれを編集すれば良いと思う。
  • # cp /lib/systemd/system/bind9.service /etc/systemd/system/bind9.serviceでファイルを作成。
  • /etc/systemd/system/bind9.serviceの内容は
[Unit]
Description=BIND Domain Name Server
Documentation=man:named(8)
After=network.target

[Service]
ExecStart=/usr/sbin/named -f -u bind
ExecReload=/usr/sbin/rndc reload
ExecStop=/usr/sbin/rndc stop

[Install]
WantedBy=multi-user.target

となっているはずなので、ExecStartを書き換える。

--- /lib/systemd/system/bind9.service   2016-11-02 02:41:51.000000000 +0900
+++ /etc/systemd/system/bind9.service   2016-12-18 22:06:27.551045089 +0900
@@ -4,7 +4,7 @@
 After=network.target
 
 [Service]
-ExecStart=/usr/sbin/named -f -u bind
+ExecStart=/usr/sbin/named -f -u bind -4
 ExecReload=/usr/sbin/rndc reload
 ExecStop=/usr/sbin/rndc stop
  • # systemctl reenable bind9 で設定反映
  • # systemctl restart bind9 で再起動(もちろん# /etc/init.d/bind9 restartでもいい と思っていたが、本当はダメらしい)

これで、/var/log/syslogに出ていたnamed[13161]: error (network unreachable) resolving 'pipe.skype.com/AAAA/IN': 2620:0:37:の様にipv6で名前解決をやろうとして失敗するログが無くなった。

参考サイト
https://wiki.debian.org/Bind9#Bind_Chroot

追記:
要するに、initじゃなくてsystemdに変わったって事なんですよね。
Debian久しぶりに触ったから知らなかった...


ちなみに環境
HW:PriusGear GN33k (10年以上前に買ったノートPC)
使っていないノートPCが有ったので、自宅サーバ用にセットアップ。Ubuntu入れようと思ったのですが、CPUが対応していなかった...。なのでDebianで。
サーバ用途なのでX入れてません。
$ uname -a
Linux prius 3.16.0-4-586 #1 Debian 3.16.36-1+deb8u2 (2016-10-19) i686 GNU/Linux

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?