Secondary DNS Server
This section describes how to integrate Plesk with an external Linux-based secondary DNS server.
Эту интеграцию можно выполнить с помощью расширения Slave DNS Manager, доступного в Каталоге расширений в интерфейсе Plesk.
Это расширение работает по следующему алгоритму:
- 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.