This section describes how to integrate Plesk with an external Linux-based secondary DNS server.

可使用 Slave DNS Manager 扩展(位于 Plesk GUI 中的 扩展目录 )执行该整合。

该扩展以下面的方式工作执行:

  1. It registers a secondary server in the extension settings.
  2. The secondary server’s IP address is automatically added to the list of addresses allowed to transfer domain zones from the Plesk server.
  3. 当您在 Plesk中创建、修改或删除一个活动的域名区域时,Plesk 则会在本地DNS服务中创建、修改或删除域名区域。
  4. 脚本会启动域名并接收命令以创建、修改或删除一个域名区域。
  5. The script initiates the rndc command for each connected secondary server.
  6. 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:

  1. 安装 BIND。

    apt-get install bind9
    
  2. 允许使用 rndc 创建新区域。在 /etc/bind/named.conf.options 文件中,于 options {} 指令里输入 allow-new-zones yes;

  3. 指定应从哪个 IP 地址接受控制指令并设置 BIND 监听所有可访问的网络接口。在 /etc/bind/named.conf.local 文件中,输入:

    controls {
        inet * port 953 allow { <plesk_ip>; <another_plesk_ip> 127.0.0.1; };
     };
    
  4. 通过下面的命令重启 BIND 服务:

    invoke-rc.d bind9 restart
    
  5. 请务必记住 /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.