Secondary DNS Server
This section describes how to integrate Plesk with an external Linux-based secondary DNS server.
可使用 Slave DNS Manager 擴展(位於 Plesk GUI 中的 擴展目錄 )執行該整合。
該擴展以下面的方式工作執行:
- It registers a secondary server in the extension settings.
- The secondary server’s IP address is automatically added to the list of addresses allowed to transfer domain zones from the Plesk server.
- 當您在 Plesk中創建、修改或刪除一個活動的域名區域時,Plesk 則會在本地DNS服務中創建、修改或刪除域名區域。
- 腳本會啟動域名並接收命令以創建、修改或刪除一個域名區域。
- The script initiates the rndc command for each connected secondary server.
- Secondary servers synchronize domain zones with the ones on the Plesk server.
備註: 下面的說明主要針對 Debian Linux。對於其它的 Linux 系統,一系列的步驟是相同的,但是命令和設定檔的路徑會有所不同。
備註: 伺服器一次只能安裝下列中的一個擴展:Slave DNS Manager、Amazon Route 53 或 DigitalOcean DNS。所有都可以管理 DNS,如果一起安裝將會衝突。
To set up a secondary DNS server, do the following:
-
安裝 BIND。
apt-get install bind9
-
允許使用
rndc
創建新區域。在/etc/bind/named.conf.options
檔中,於options {}
指令裡輸入allow-new-zones yes;
-
指定應從哪個 IP 位址接受控制指令並設定 BIND 監聽所有可存取的網路介面。在
/etc/bind/named.conf.local
檔中,輸入:controls { inet * port 953 allow { <plesk_ip>; <another_plesk_ip> 127.0.0.1; }; };
-
通過下面的命令重啟 BIND 服務:
invoke-rc.d bind9 restart
-
請務必記住
/etc/bind/rndc.key
文件中的金鑰:key "rndc-key" { algorithm hmac-md5; secret "vwOxonI4n4CVRUhKAOAAIA=="; };
That’s it, the secondary name server is set up.
備註: If your Plesk server is behind NAT, the secondary DNS server(s) must be outside of it.
After that, install the extension on the Plesk server. In the extension
settings, add the secondary server and specify its IP address and the secret
key. The extension will create a configuration file with the secondary
server settings for the rndc
utility. From now on, Plesk will
automatically transfer all created, modified, and deleted zones to the
secondary server by executing the following commands for each secondary server:
創建
/usr/sbin/rndc -c slave.config addzone example.com '{ type slave; file "/var/lib/bind/example.com"; masters { <plesk_ip>; }; };'
修改
/usr/sbin/rndc -c slave.config refresh example.com
刪除
/usr/sbin/rndc -c slave.config delzone example.com
Now, when you add a domain in Plesk, a DNS zone is automatically created on the secondary server as well as on the primary server.