今まで自宅の環境ではNSD(Master) – NSD(Slave)な環境だったんですけど、少しは変えておきたいなということで、Slaveの1台をKnot DNSに置き換えてみました。
他にもBINDとかPowerDNS Authとかありますけど、BINDはまぁ・・・、PowerDNS Authは、機材がAArch64環境なのと、小さい環境なんで、DB入れたり、そこまで大きな環境を維持するわけではないので大袈裟かと思い、Knot DNSにしました。
Knot DNS
High-performance authoritative DNS server
web情報
公式ドキュメントはこちら。
sampleなconfと、公式ドキュメントにslaveにする場合の設定例があるので、そちらを参照するとサクッと設定だけは出来ると思います。
確認環境:
knot knotc -V
knotc (Knot DNS), version 2.7.dev.1526708515.edda2249f
設定ファイル
server:
listen: 0.0.0.0@53
listen: ::@53
remote:
- id: master
address: 192.168.1.1@53
acl:
- id: notify_from_master
address: 192.168.1.1
action: notify
zone:
- domain: example.com
storage: /var/lib/knot/zones/
# file: example.com.zone # Default value
master: master
acl: notify_from_master
セクションごとに設定値を入れていくという感じですね。
いくつかのコマンド
んで適用前に以下のコマンドを実行することで、confファイルのエラーをチェックできます。
$ knotc conf-check
Configuration is valid
問題がなかったら以下のコマンドを実行して適用。Knot DNSを使って初めて知ったのですが、基本的にサービスを止めたりする必要がないんですね・・・
$ knotc reload
Reloaded
ちなみに設定を動的に追加して、設定前のパラメータとdiffして、問題がなかったらcommitして、みたいなオペレーションについては、ドキュメントに書いてあります。
状態の確認
稼働中の状態については以下のコマンドなどで確認できます。
$ knotc status
Running
$ knotc zone-status
[1.168.192.in-addr.arpa.] role: slave | serial: 2018010501 | transaction: none | freeze: no | refresh: +23m30s | update: not scheduled | expiration: +6D23h23m30s | journal flush: not scheduled | notify: not scheduled | DNSSEC re-sign: not scheduled | NSEC3 resalt: not scheduled | parent DS query: not scheduled
[kometch.local.] role: slave | serial: 2018010501 | transaction: none | freeze: no | refresh: +53m42s | update: not scheduled | expiration: +6D23h53m42s | journal flush: not scheduled | notify: not scheduled | DNSSEC re-sign: not scheduled | NSEC3 resalt: not scheduled | parent DS query: not scheduled
$ knotc zone-memstats
[1.168.192.in-addr.arpa.] 19 records, 0.0 MiB memory
[kometch.local.] 32 records, 0.0 MiB memory Total 0.0 MiB memory
$ knotc stats
server.zone-count = 3
mod-rrl.slipped = 0
mod-rrl.dropped = 0
mod-stats.request-protocol[udp4] = 922
mod-stats.server-operation[query] = 922
mod-stats.request-bytes[query] = 33566
mod-stats.response-bytes[reply] = 41794
mod-stats.response-code[NOERROR] = 374
mod-stats.response-code[REFUSED] = 548
とりあえず入れてみただけなので、もう少し使い続けてみようと思います。