dnsmasq 2.89-7 から、/etc/dnsmasq.conf に書かれている デフォルトの設定が変更になりました。 このアップデート適用後から、私のサーバではエラーが発生し、dnsmasq が起動しなくなりました。

何が変わった?

/etc/dnsmasq.conf の変更点は以下の 3ヵ所です。

# If you want dnsmasq to listen for DHCP and DNS requests only on
# specified interfaces (and the loopback) give the name of the
# interface (eg eth0) here.
# Repeat the line for more than one interface.
#interface=
# Listen only on localhost by default
interface=lo
# Or you can specify which interface _not_ to listen on
#except-interface=
# Or which to listen on by address (remember to include 127.0.0.1 if
# you use this.)
# Serve DNS and DHCP only to networks directly connected to this machine.
# Any interface= line will override it.
#local-service
# Accept queries in default configuration only from localhost
# Comment out following option or explicitly configure interfaces or
# listen-address
local-service=host
# To listen only on localhost and do not receive packets on other
# interfaces, bind only to lo device. Comment out to bind on single
# wildcard socket.
bind-interfaces
 
#bind-interfaces
# Comment out above line and uncoment following 2 lines.
# Update interface name, use ip link to get its name.
#bind-dynamic
#interface=eno1

この変更に関する元のチケットは以下のものです。

今回の変更は local-service=host がメインで、他の変更はこれに伴う辻褄合わせです。「この方がセキュアだし、この変更は動作に何の影響も与えない」との触れ込みでしたが、実際には、私の設定ではエラーが出て起動できなくなりました。

コメントに、interfacelisten-addressを明示的に設定したらいいよ、と書かれていますが、明示的に設定しても有効になりません。bind-interfaces がコメントアウトされていますが、コメントアウト解除すると旧来の設定で問題なく動きます。

現時点では、コメントに書かれていることと、実際の挙動が一致しないため、私の中でも結論は出ていません。とりあえず、bind-interfaces を有効すると、コメントの通りに動くので、お困りの場合は、そのようにしてみてはいかがでしょう(自己責任でお願いします)。

一応、私の設定を書いておきます。VPN 側(192.168.16.1)専用の DNS サーバとして使っています。

# Listen on by address (remember to include 127.0.0.1 if you use this.)
listen-address=192.168.16.1,fd64:736e:828b:0:192:168:16:1

# Do not use /etc/hosts.
no-hosts

# Use additional hosts.
addn-hosts=/etc/hosts-dnsmasq

# Local domain name.
domain=seinolab.jp

# Expand automatically.
expand-hosts

# Never forward plain names (without a dot or domain part)
domain-needed

# Never forward addresses in the non-routed address spaces.
bogus-priv