2010年4月26日

如何建立 rndc 管理 bind 9

Bind 9 之後提供 "rndc" (remote name daemon control),它可使系統管理者利用 rndc command遠端或本端(localhost)控制管理Bind,並以加密方式來傳送資料,以防止其他非授權使用者控制Bind,作法如下:

//產生 rndc.conf
shell># rndc-confgen > /etc/rndc.conf

//執行 "rndc-confgen > /etc/rndc.conf" 後,會產生 /etc/rndc.conf 檔,內容如下:
# Start of rndc.conf
key "rndckey" {
algorithm hmac-md5;
secret "VRg7SR9B2rvTeLPcPSfCPA==";
};

options {
default-key "rndckey";
default-server 127.0.0.1;
default-port 953;
};
# End of rndc.conf

# Use with the following in named.conf, adjusting the allow list as needed:

# key "rndckey" {
# algorithm hmac-md5;
# secret "VRg7SR9B2rvTeLPcPSfCPA==";
# };
#
# controls {
# inet 127.0.0.1 port 953
# allow { 127.0.0.1; } keys { "rndckey"; };
# };

# End of named.conf


將 rndc.conf 裡有關 named.conf 的資料(上方的藍色文字區)貼到 /etc/named.conf ,記得要把註解拿掉,重新啟動 named 服務,就可以開始使用 rndc 的功能了。

參考文獻
man rndc
twnic BIND介紹與安裝 > rndc

沒有留言:

張貼留言