named.conf の acl は include を跨いでも有効

1. view 構文で acl を利用する


BIND 9 の named.conf で view 構文を使用する際に、acl 機能を用(もち)いた

その際に設定再読み込みを行うと、

● bind9.service - BIND Domain Name Server

Loaded: loaded (/lib/systemd/system/bind9.service; enabled)

Drop-In: /run/systemd/generator/bind9.service.d

mq50-insserv.conf-$named.conf

Active: active (running) (Result: exit-code) since 金 2015-06-05 07:26:13 JST; 6 days ago

Docs: man:named(8)

Process: 29762 ExecReload=/usr/sbin/rndc reload (code=exited, status=1/FAILURE)

Main PID: 440 (named)

CGroup: /system.slice/bind9.service

mq440 /usr/sbin/named -f -u bind

6月 11 15:43:13 senri named[440]: received control channel command 'reload'
6月 11 15:43:13 senri named[440]: loading configuration from '/etc/bind/named.conf'
6月 11 15:43:13 senri named[440]: /etc/bind/named.conf:13: attempt to redefine acl...l:9
6月 11 15:43:13 senri named[440]: reloading configuration failed: failure

と言われて しまった
一体何の事やら…と思ったら、何の事は無い、/etc/bind/named.conf と /etc/bind/named.conf.local で同じ acl 文が定義して しまって いて、重複で あると怒っている らしい
Debian で bind 9 を導入すると named.conf は標準で以下の記述と なっている ので、

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";

ここに named.conf と named.conf.local に以下の行を書いて しまったので、これが拙(まず)い らしい

// prime the server with knowledge of the root servers

acl internal-zones { 192.168.0.0/24;

127.0.0.1;

};

そう言うものなのか…



2. acl は何処(どこ)で定義しても include 行を跨(またが)って有効と なる


更に試行して見ると、acl を named.conf.local で定義すると その acl は named.conf.default-zones でも有効と なって しまった
うぅむ、そう言うものなのか…

当然、named.conf や named.conf.options も適用対象と なるが、流石に named.conf.options に acl を定義する事は無いで あろう
ただ、named.conf.local で定義した acl が named.conf で適用されると言うのは、あるべき姿なのかと言うと、少し違う様(よう)な気が しないでも無い

やはり named.conf で全ての acl を一括定義し、それを include 先にも反映させると言う指定の方が、少なくとも私には落ち付く設定の書き方で ある様に思える

公開 : 2015年6月15日
戻る
pagetop