部内用サブドメインがうまく動作しなかった件
riseからCTF問題サーバ(lambda)に立てたDNSサーバにctf.mma以下を委譲しようとしたが結果が返ってこなかった件について。
DNSの構成はおおよそ次の通り。要点以外は省略。
- rise側(キャッシュサーバとコンテンツサーバを兼ねる)
- グローバルでforwardersに大学のDNSサーバ
内部用のmmaゾーンに
ctf IN NS ns.ctf ns.ctf IN A (lambdaのIPアドレス)
- lambda側(コンテンツサーバ)
- ctf.mmaのゾーンファイルを普通に設置
- @ IN SOA, @ IN NS, ns IN A, その他
rise側のエラーログを見ると、なぜか大学のDNSサーバから返ってきたパケットに関するエラーメッセージが。
lxcで実験環境を作って試してみたところ、ns.ctf.mmaを含むctf.mma以下への問い合わせには、rise役のサーバから上流のサーバ(つまり大学のサーバ)に対して問い合わせが発生してから、lambda役のサーバへの問い合わせが行われていることがわかった。
Bind 9.7のドキュメントによれば
- Forwarding
- (略) Forwarding occurs only on those queries for which the server is not authoritative and does not have the answer in its cache.
This option is only meaningful if the forwarders list is not empty. A value of first, the default, causes the server to query the forwarders first — and if that doesn't answer the question, the server will then look for the answer itself. If only is specified, the server will only query the forwarders.
というわけで、そのサーバが権威サーバではないゾーン(委譲しているからctf.mma以下はauthoritativeではない)については、とりあえずforwardersのサーバに聞いてみて、駄目なら自分で見に行くという事になっている。
riseの持つmmaゾーン以下はMMA内部用であるからして外部に問い合わせに行かないのが正しい設定のはずである。よって、mmaゾーンのforwardersを空に設定することで解決した。