By default, a Plesk server acts as a master DNS server for websites hosted on it. Alternatively, you can use external third-party DNS services to resolve domain names hosted in Plesk, for example, Amazon Route 53 (http://aws.amazon.com/route53/), DynECT (http://dyn.com/dns/dynect-managed-dns/), or Godaddy Premium DNS (http://www.godaddy.com/domains/dns-hosting.aspx). Using such services has certain advantages:
If you plan to use an external third-party DNS service, you can configure your Plesk so that it uses this service instead of its own DNS server. This will not affect website owners: From their perspective, Plesk stays a master DNS server for their domains.
To make your Plesk automatically provision DNS zones to a third-party DNS, you should write an integration script.
The integration script is a script (written in any language supported by your server) that propagates changes made to DNS zones in Plesk UI to the selected third-party DNS service. The script should communicate with the external service by means of the service's API.
After you register the script in Plesk, the latter will pass to the script information about any change in DNS zones, for example, adding or removing resource records or entire zones.
The script must meet the following requirements:
errorcode0
.stdout
and sterr
.An example of the script that integrates Plesk with the Amazon Route 53 is available on our GitHub page.
Note that to use this script, you should take two steps:
aws.phar
from http://aws.amazon.com/sdkforphp/ and place it in the same directory with the script.'client' => array(
'key' => '<key>',
'secret' => '<secret>',
),
Note: All parameters are of the string
type.
Parameter |
Description |
Example |
||
command |
|
|
The operation that should be performed on the specified zone ( |
|
|
|
|
Information about the zone on which the operation is performed. Provided if the |
|
|
|
The name of the zone. |
|
|
|
|
The name of the zone without IDN to ASCII conversion. |
|
|
|
|
Information about the SOA resource record in the zone. Provided if the |
|
|
|
Contact email |
|
||
|
Always |
|
||
|
Type of the DNS server. Always |
|
||
|
The amount of time in seconds that other DNS servers should store the record in a cache. |
|
||
|
Time in seconds how often the secondary name servers check with the primary name server to see if any changes have been made to the domain's zone file. |
|
||
|
Time in seconds a secondary server waits before retrying a failed zone transfer. |
|
||
|
Time in seconds before a secondary server stops responding to queries, after a lapsed refresh interval where the zone was not refreshed or updated. |
|
||
|
Time in seconds a secondary server should cache a negative response |
|
||
|
The number that identifies the state of the zone. Plesk uses the Unix time stamp of the moment when the request is sent. |
|
||
|
Always |
|
||
|
|
Information about resource records within the specified zone. Provided if the |
|
|
|
The host name of a node within the zone. |
|
||
|
The host name of a node without IDN to ASCII conversion. |
|
||
|
The type of the record. |
|
||
|
The part of the |
|
||
|
A value (IP address of host name) of the resource that will be available on the specified |
|
||
|
A value (IP address of host name) of the resource that will be available on the specified |
|
||
|
|
|
Information about the reverse (PTR) records. Provided if the |
|
|
|
The reverse record's IP address. May be IPv4 or IPv6 address. |
|
|
|
|
The reverse record's host name. |
|
To switch on Plesk integration with third-party DNS:
/plib/scripts/
directory. For example: /plib/scripts/route53.php
.On Linux: plesk bin extension --exec <extension_id> <script_name>
On Windows: <plesk_dir>\bin\extension.exe --exec <extension_id> <script_name>
For example: plesk bin extension --exec route53 route53.php
On Linux: plesk bin server_dns --enable-custom-backend <script_execution>
On Windows: <plesk_dir>\bin\server_dns.exe --enable-custom-backend <script_execution>
For example:
$script = 'plesk bin extension --exec route53 route53.php';
$result = pm_ApiCli::call('server_dns', ['--enable-custom-backend', $script]);
To switch off Plesk integration with third-party DNS and restore the default settings:
On Linux: plesk bin server_dns --disable-custom-backend
On Windows: <plesk_dir>\bin\server_dns.exe --disable-custom-backend
For example:
$result = pm_ApiCli::call('server_dns', ['--disable-custom-backend']);
You can find a complete example of the integration on github: https://github.com/plesk/ext-route53