rndc ユーティリティは、named サービスをローカルとリモート マシンの両方で管理するためのコマンド ライン ツールです。サービスへの不正アクセスを防止するには、選択したポート (デフォルトではポート 953) でリッスンするように rndc を構成する必要があり、サービスと rndc ユーティリティの両方で同じキーを使用する必要があります。 rndc キーは、次のコマンドを使用して生成されます:
# rndc-confgen -a wrote key file "/etc/rndc.key"
このコマンドは /etc/rndc.key を作成します キーを含むファイル。
# cat /etc/rndc.key
key "rndc-key" {
algorithm hmac-md5;
secret "k7WFNCP01e1NwIgaIhvtQQ==";
}; キーを使用するように named を構成するには、/etc/named.conf に次のエントリを含めます。 :
# vi /etc/named.conf<
include “/etc/rndc.key”;
controls {
inet 127.0.0.1 allow { localhost; } keys { “rndckey”; }
}; include ステートメントを使用すると、ファイルを含めることができるため、機密性の高いデータをアクセス許可が制限された別のファイルに配置できます。 root のみがファイルを読み取れるようにするには、次のように入力します:
# chmod o-rwx /etc/rndc.key
コントロール ステートメントは、アクセス情報と、rndc コマンドを使用するために必要なさまざまなセキュリティ要件を定義します。
- inet :この例では、localhost (127.0.0.1) のコンソールから rndc を制御できます。
- キー :キーは、さまざまなアクションを認証するために使用され、リモート管理の主要なアクセス制御方法です。この例では、/etc/rndc.key インクルード ファイルで定義されている rndckey の使用を指定しています。
rndc コマンドの例
rndc と入力して、ユーティリティの使用法と使用可能なコマンドのリストを表示します。
# rndc
Usage: rndc [-b address] [-c config] [-s server] [-p port]
[-k key-file ] [-y key] [-V] command
command is one of the following:
reload Reload configuration file and zones.
reload zone [class [view]]
Reload a single zone.
refresh zone [class [view]]
Schedule immediate maintenance for a zone.
retransfer zone [class [view]]
Retransfer a single zone without checking the serial number.
freeze Suspend updates to all dynamic zones.
freeze zone [class [view]]
Suspend updates to a dynamic zone.
thaw Enable updates to all dynamic zones and reload them.
thaw zone [class [view]]
Enable updates to a frozen dynamic zone and reload it.
sync [-clean] Dump changes to all dynamic zones to disk, and optionally
.... 以下は、rndc コマンドの一部の例です:
1. rndc status コマンドを使用して、名前付きサービスの現在のステータスを確認します。
# rndc status number of zones: 3 debug level: 0 xfers running: 0 xfers deferred: 0 soa queries in progress: 0 query logging is OFF recursive clients: 0/1000 tcp clients: 0/100 server is up and running
rndc reload コマンドを使用して、構成ファイルとゾーンの両方を再読み込みします。
# rndc reload server reload successful