3
2

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.

BindのSlaveサーバでのゾーン転送設定漏れ(/var/namedのパーミッション設定漏れ)

Posted at

LAN用のDNSサーバなんてぇのは本当は置きたくないんですが、
どうにもdns名をハードコードしないとプログラムが作れないらしく
仕方なく社内LAN向けのゾーンサーバを立てているのですが。

どうもゾーン転送がうまくいかない。

ログを追ってみたら以下の通り。

zone example.org/IN: transfer: could not set file modification time of '/var/named/example.org.zone': permission denied

書き込めない、と…

とりあえずゾーンファイルを確認。

# ll example.org.zone
-rw-r--r-- 1 root  root   766 mm dd hh:mm yyyy example.org.zone

PSでプロセス確認。

# ps auxww | grep named
named     1533  0.6  6.5 179576 32640 ?        Ssl  13:19   0:53 /usr/sbin/named -u named

…………………………
そりゃ書けませんよね。

今回のミスは、rootでゾーンファイル作成したことが原因。
rootで作ってもいいんですけど、パーミッション、オーナーを変えてないのがダメな点。
とりあえず以下2コマンドで変更。

# chmod 664 example.org.zone
# chown root:named example.org.zone

ってしまして、Slave側で

# rndc retransfer example.org

しますが、失敗…

答えはここ。

# ll -d /var/named
drwxr-x--- 5 root named 4096 mm dd hh:mm yyyy /var/named

デフォルトだと、/var/namedディレクトリに対してグループに書き込み権限はなし。
セキュリティ面を考えると妥当な設定ですね。
しかし、ゾーン転送を受けるDNS Slaveサーバはnamedプロセスから書き込みできないと
zoneのSerialが更新されてるのを確認してSlave自身のゾーンファイルの更新をしたいのに
書き込み権限がないので、更新ができないという事象が発生していた模様。

とりあえず、

# chmod 770 /var/named

でパーミッションを変更したらうまくいきました。

でも、これでいいのか…?

3
2
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
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?