The server_dns utility is used to manage the Plesk server's DNS zone template through CLI. By using this utility, you can perform the following tasks:
Syntax
server_dns <command> [
<option_1> [<param>]
[<option_2> [<param>]]
…[<option_N> [<param>]]
]
Example
The following command line adds the following two resource records to the domain DNS zone template, while removing all pre-existing resource records from the domain DNS zone template:
MX resource record <domain> specifying mail.<domain> as the mail exchanger for the record, and setting the mail exchanger's priority to 15.NS resource record <domain> setting domain ns.<domain> as the name server.# ./server_dns --set "MX,"",mail.<domain>,15;NS,"",ns.<domain>"
Commands
Command |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Adds a resource record to the Plesk server's domain DNS zone template. If a record already exists, the command returns code |
To add new MX resource record mail.<domain> to the domain DNS zone template and specify mail exchanger mail.<domain> and set the mail exchanger priority to 35 for the record: # ./server_dns --add -mx "" -mailexchanger "mail.<domain>" -priority 35 or # ./server_dns -a -mx "" -mailexchanger "mail.<domain>" -priority 35 |
|
where
|
Adds specified resource records to and removes all pre-existing resource records from the Plesk server's domain DNS zone template. For more details, consult descriptions of the options in the following table for adding resource records of respective types individually. |
To add the following two resource records to the domain DNS zone template, while removing all pre-existing resource records from the DNS zone:
or # ./server_dns -s "MX,"",<domain>,15;NS,"",ns.<domain>" |
|
|
Updates the Plesk server's domain DNS zone template. |
To enable support for recursive DNS queries for hosts on the local network only: # ./server_dns -u -recursion localnets |
|
|
Updates the SOA record settings the Plesk server's domain DNS zone template. |
To set the TTL parameter to 5 hours for the SOA record for the domain DNS zone template: # ./server_dns --update-soa -soa-ttl 5H |
|
|
Displays the list of resource records for the Plesk server's domain DNS zone template. |
To display the list of resource records in the domain DNS zone template: # ./server_dns --info |
|
|
Displays help on the use of the utility. |
To display help on the use of the dns utility: # ./server_dns --help or # ./server_dns –h |
Options
Option |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Sets the Plesk name server DNS zone preferences:
Used with the |
To enable support for recursive DNS queries for hosts on the local network only: # ./server_dns -u -recursion localnets |
|
|
Sets the status of a domain's DNS zone (Enabled or Disabled) when the domain DNS zone is created during domain creation. Only newly created domains will inherit the DNS zone status. Used with the |
To disable domain DNS zones for newly created domains: # ./server_dns -u -status disabled |
|
|
Adds host or network IP addresses to the Access Control list (ACL) |
To add records 192.168.67.78 and 192.168.0.0/24 to the ACL: # ./server_dns -u -add-acl 192.168.67.78,192.168.0.0/24 |
|
|
Specifies the Used with the Requires concomitant use of the |
To add new A resource record subdom.<domain> (specifying a placeholder for a domain IP address for the record) to the domain DNS zone template: # ./server_dns -a -a subdom -ip "<ip>" |
|
|
Specifies an IP address or a placeholder for a domain's IP address for creating an A type resource record in the Plesk server's domain DNS zone template. Used only with the |
|
|
|
Specifies the Used only with the Requires concomitant use of the |
To add a new NS resource record <domain> specifying domain name <domain> as the name server to the DNS zone template: # ./server_dns -a -ns "" -nameserver "ns.<domain>" |
|
|
Specifies the name of a nameserver or a placeholder for creating an NS type resource record in the Plesk server's domain DNS zone template. |
|
|
|
Specifies the Used only with the Requires concomitant use of the |
To add new MX resource record <domain> specifying domain name mail.<domain> as the mail exchanger for the record, and setting the mail exchanger's priority to 15 to the domain DNS zone template: # ./server_dns -a -mx "" -mailexchanger "mail.<domain>" -priority 15 |
|
|
Specifies the name of a mailexchanger or a placeholder for creating an MX type DNS record in the Plesk server's domain DNS zone template. |
|
|
|
Specifies the mail exchanger priority for creating an MX type DNS record in the Plesk server's domain DNS zone template. |
|
|
|
Specifies the Used only with the Requires concomitant use of the |
To add new CNAME type resource record subdom.<domain> for a canonical name <domain> to the domain DNS zone template: # ./server_dns -a -cname subdom -canonical "<domain>" |
|
|
Specifies a canonical name or a placeholder for creating a CNAME type DNS record in the Plesk server's domain DNS zone template. |
|
|
|
Specifies the Used with the Requires concomitant use of the |
To add new PTR type DNS record "<ip>"/16 for <domain> to the domain DNS zone template: # ./server_dns -a -ptr "" -subnet "<ip>"/16 |
|
|
Specifies an IP address and a subnet mask or a placeholder for creating a PTR type DNS record in the Plesk server's domain DNS zone template. |
|
|
|
Specifies the Used only with the Requires concomitant use of the |
To specify the TXT type DNS record "This record is used to implement the Senders Policy Framework and DomainKeys specifications" for the specific subdomain name subdom in the domain DNS zone template: # ./server_dns -a -txt "This record is used to implement the Senders Policy Framework and DomainKeys specifications" -domain subdom |
|
|
Specifies a subdomain name for creating a TXT type resource record in the Plesk server's domain DNS zone template. Used only with the |
|
|
|
Sets the TTL parameter for the SOA record in the Plesk server's domain DNS zone template. Used with the |
To set the TTL parameter to 5 hours, the Refresh parameter to 4 hours, the Retry parameter to 10 seconds, the Expire parameter to 2 weeks, and the Minimum parameter to 2 days for the SOA record in the domain DNS zone template: # ./server_dns --update-soa -soa-ttl 5H -soa-refresh 4H -soa-retry 10S -soa-expire 2W -soa-minimum 2D |
|
|
Sets the Refresh parameter for the SOA record in the Plesk server's domain DNS zone template. Used with the |
|
|
|
Sets the Retry parameter for the SOA record in the Plesk server's domain DNS zone template. Used with the |
|
|
|
Sets the Expire parameter for the SOA record in the Plesk server's domain DNS zone template. Used with the |
|
|
|
Sets the Minimum parameter for the SOA record in the Plesk server's domain DNS zone template. Used with the |