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:
Usage
server_dns <command> [
<option_1> [<param>]
[<option_2> [<param>]]
… [<option_N> [<param>]]
]
Example
The following command 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 # ./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 view the list of resource records in the domain DNS zone template: # ./server_dns --info |
|
|
Displays help on the use of the utility. |
To view 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 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.0.2.78 and 192.0.2.0/24 to the ACL: # ./server_dns -u -add-acl 192.0.2.78,192.0.2.0/24 |
|
|
Specifies the Used with the Requires the |
To add new # ./server_dns -a -a sample -ip "<ip>" |
|
|
Specifies an IP address or a placeholder for a domain's IP address for creating an Used only with the |
|
|
|
Specifies the Used only with the Requires the |
To add a new # ./server_dns -a -ns "" -nameserver "ns.<domain>" |
|
|
Specifies the name of a nameserver or a placeholder for creating an |
|
|
|
Specifies the Used with the Requires the |
To add new # ./server_dns -a -mx "" -mailexchanger "mail.<domain>" -priority 15 |
|
|
Specifies the name of a mailexchanger or a placeholder for creating an |
|
|
|
Specifies the mail exchanger priority for creating an |
|
|
|
Specifies the Used with the Requires concomitant use of the |
To add new # ./server_dns -a -cname subdom -canonical "<domain>" |
|
|
Specifies a canonical name or a placeholder for creating a |
|
|
|
Specifies the Used with the Requires concomitant use of the |
To add new # ./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 with the Requires the |
To specify the # ./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 Used with the |
|
|
|
Specifies the TTL value for the SOA record in the Plesk server's domain DNS zone template. Used with the |
To set the TTL value to 5 hours, the Refresh value to 4 hours, the Retry value to 10 seconds, the Expire value to 2 weeks, and the Minimum value 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 |
|
|
Specifies the Refresh value for the SOA record in the Plesk server's domain DNS zone template. Used with the |
|
|
|
Specifies the Retry value for the SOA record in the Plesk server's domain DNS zone template. Used with the |
|
|
|
Specifies the Expire value for the SOA record in the Plesk server's domain DNS zone template. Used with the |
|
|
|
Specifies the Minimum value for the SOA record in the Plesk server's domain DNS zone template. Used with the |