The dns utility is used to manage DNS zones on domains and domain aliases through CLI. By using this utility, you can perform the following tasks:
www-prefixed alias (in the www.<domain name> form) support for canonical domain names
Syntax
dns <command> <domain name>|<domain alias> [
<option_1> [<param>]
[<option_2> [<param>]]
…[<option_N> [<param>]]
]
Example
The following command line removes all pre-existing resource records from the DNS zone on domain example.com and adds the following two records to the DNS zone:
MX resource record mail3.example.com specifying domain name mail.example.com as the mail exchanger and setting the mail exchanger's priority to 15NS resource record ns2.example.com setting domain ns.example.com as the name server# ./dns --set example.com -list "MX,mail3,mail.example.com,15;NS,ns2,ns.example.com"
Commands
Command |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Àdds a resource record to a domain's DNS zone. If a record already exists, the command returns code |
To add new MX resource record mail3.example.com to the DNS zone on domain example.com and specify mail exchanger mail.example.com for the record: # ./dns --add example.com -mx mail3 -mailexchanger mail.example.com or # ./dns -a example.com -mx mail3 -mailexchanger mail.example.com |
|
|
Adds specified resource records to and removes all pre-existing resource records from a domain's DNS zone. Requires concomitant use of the |
To add the following two resource records to the DNS zone of domain example.com, while removing all pre-existing resource records from the DNS zone:
or # ./dns -s example.com -list "MX,mail3,example.com,15;NS,ns2,ns.example.com" |
|
|
Deletes a resource record from a domain's DNS zone. |
To delete an existing MX resource record mail3.example.com (for which mail exchanger mail.example.com is specified) from the DNS zone for domain example.com: # ./dns --del example.com -mx mail3 -mailexchanger mail.example.com or # ./dns -d example.com -mx mail3 -mailexchanger mail.example.com |
|
|
Deletes all resource records from a domain's DNS zone. |
To delete all existing resource records from the DNS zone for domain example.com: # ./dns --del-all example.com or # ./dns -da example.com |
|
|
Restores the default resource records for a domain's zone based on the Plesk server DNS zone template. Requires concomitant use of the |
To restore the default resource records for a domain's zone based on the Plesk server DNS zone template: # ./dns --reset example.com -ip 81.1.204.9 or # ./dns -res example.com -ip 81.1.204.9 |
|
|
Enables DNS service on a domain or domain alias. |
To enable DNS service on domain example.com: # ./dns --on example.com |
|
|
Disables DNS service on a domain or domain alias. |
To disable DNS service on domain example.com: # ./dns --off example.com |
|
|
Sets the Plesk name server as the master server for domain's or domain alias' DNS zone. |
To set the Plesk name server as the master server for DNS zone on domain example.com: # ./dns --set-master example.com |
|
|
Sets the Plesk name server as the slave server for domain's or domain alias' DNS zone. |
To set the Plesk name server as the slave server for DNS zone on domain example.com: # ./dns --set-slave example.com |
|
|
Updates the SOA record settings for domain's or domain alias' DNS zone. |
To set the TTL parameter to 5 hours for the SOA record for the DNS zone on domain example.com: # ./dns --update-soa example.com -soa-ttl 5H |
|
|
Displays the list of resource records for a domain's or domain alias' DNS zone. |
To display the list of resource records in the DNS zone for domain example.com: # ./dns --info example.com |
|
|
Displays help on the use of the utility. |
To display help on the use of the dns utility: # ./dns --help or # ./dns –h |
Options
Option |
Parameter |
Description |
Example |
|
|
Specifies the Used with the Requires concomitant use of the |
To add new A resource record subdom.example.com specifying IP address 192.168.67.78 for the subdomain to the DNS zone on domain example.com: # ./dns -a example.com -a subdom -ip 192.168.67.78 |
|
|
Specifies an IP address for creating an A type resource record in a domain's DNS zone. Used with the |
|
|
|
Specifies the Used with the Requires concomitant use of the |
To add a new NS resource record ns2.example.com specifying domain name example.net as the name server to the DNS zone on domain name example.com: # ./dns -a example.com -ns ns2 -nameserver example.net
|
|
|
Specifies the name of a nameserver for creating an NS type resource record in a domain's DNS zone. |
|
|
|
Specifies the Used with the Requires concomitant use of the |
To add new MX resource record mail3.example.com specifying domain name mail.example.com as the mail exchanger for the record, and setting the mail exchanger's priority to 15 to the DNS zone on domain example.com: # ./dns -a example.com -mx mail3 -mailexchanger mail.example.com -priority 15
|
|
|
Specifies the name of a mail exchanger for creating an MX type DNS record in a domain's DNS zone. |
|
|
|
Specifies the mail exchanger priority for creating an MX type DNS record in a domain's DNS zone. |
|
|
|
Specifies the Used with the Requires concomitant use of the |
To add new CNAME type resource record subdom.example.com for a canonical name example.org to the DNS zone on domain example.com: # ./dns --add example.com -cname subdom -canonical example.org
|
|
|
Specifies a canonical name for creating a CNAME type DNS record in a domain's DNS zone. |
|
|
|
Specifies the Used with the Requires concomitant use of the |
To add new PTR type DNS record 192.168.12.1/16 for subdomain subdom in the DNS zone for domain example.com: # ./dns -a example.com -ptr subdom -subnet 192.168.12.1/16
|
|
|
Specifies an IP address and a subnet mask for creating a PTR type DNS record in a domain's DNS zone. |
|
|
|
Specifies the Used 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 subdomain name subdom in the DNS zone for domain example.com: # ./dns -a example.com -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 a domain's DNS zone. Used with the |
|
|
|
Enables or disables support of the Used with the Creates or deletes a |
To enable support of the www-prefixed alias www.example.com (pointing to domain example.com) in the DNS zone on domain example.com: # ./dns -res example.com -www true |
|
|
Adds an IP address of a primary DNS server for a domain's DNS zone. Used with the |
To add IP address 192.168.67.78 of the primary DNS server for DNS zone on domain example.com: # ./dns -a example.com -www true |
|
|
Sets the TTL parameter for the SOA record for a domain' or domain alias' DNS zone. 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 DNS zone on domain example.com: # ./dns --update-soa example.com -soa-ttl 5H -soa-refresh 4H -soa-retry 10S -soa-expire 2W -soa-minimum 2D |
|
|
Sets the Refresh parameter for the SOA record for a domain' or domain alias' DNS zone. Used with the |
|
|
|
Sets the Retry parameter for the SOA record for a domain' or domain alias' DNS zone. Used with the |
|
|
|
Sets the Expire parameter for the SOA record for a domain' or domain alias' DNS zone. Used with the |
|
|
|
Sets the Minimum parameter for the SOA record for a domain' or domain alias' DNS zone. Used with the |
|
|
where the
Consult descriptions of the options in this table for adding resource records of respective types individually. |
Specifies resource records to be included in a domain's DNS zone. Used with the |
To add the following two resource records to the DNS zone of domain example.com, while removing all pre-existing resource records from the DNS zone:
|