dns.exe: DNS Zones on Domains
The dns.exe utility is used to manage DNS zones on domains and
domain aliases. Using this utility, you can perform the following tasks:
enabling/disabling a local DNS service on a domain or domain alias
adding/deleting resource records to/from a domain’s or domain alias’ DNS zone
setting Plesk name server as the primary or secondary server for a DNS zone
assigning external primary DNS servers for a DNS zone
enabling or disabling the www-prefixed alias (in the
www.<domain name>form) support for canonical domain namesupdating the Start-of-Authority (SOA) record for a DNS zone
Location
%plesk_cli%
Usage
dns.exe <command> [<domain name>|<domain_alias>] [
<option_1> [<param>]
[<option_2> [<param>]]
... [<option_N> [<param>]]
]
Example
The following command removes all pre-existing resource records from the DNS zone on the domain example.com and adds the following two records to the DNS zone:
new
MXresource record mail3.example.com specifying domain name mail.example.com as the mail exchanger and setting the mail exchanger’s priority to 15-
new
NSresource record ns2.example.com setting domain ns.example.com as the name serverplesk bin dns.exe --set example.com -list "MX,mail3,mail.example.com,15;NS,ns2,ns.example.com"
Commands
Command |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Adds a resource record to a domain’s DNS zone. If a record already exists, the command returns code |
To add an plesk bin dns.exe --add example.com -mx mail3 -mailexchanger mail.example.com or plesk bin dns.exe -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 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 plesk bin dns.exe -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 plesk bin dns.exe --del example.com -mx mail3 -mailexchanger mail.example.com or plesk bin dns.exe -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 the domain example.com: plesk bin dns.exe --del-all example.com or plesk bin dns.exe -da example.com |
|
|
Restores the default resource records for a domain’s zone based on the Plesk server DNS zone template. Requires the |
To restore the default resource records for a domain’s zone based on the Plesk server DNS zone template: plesk bin dns.exe --reset example.com -ip 192.0.2.9 or plesk bin dns.exe -res example.com -ip 192.0.2.9 |
|
|
Enables DNS service on a domain or domain alias. |
To enable DNS service on the domain example.com: plesk bin dns.exe --on example.com |
|
|
Disables DNS service on a domain or domain alias. |
To disable DNS service on the domain example.com: plesk bin dns.exe --off example.com |
|
|
Sets the Plesk name server as the primary server for domain’s or domain alias’ DNS zone. |
To set the Plesk name server as the primary server for DNS zone on the domain example.com: plesk bin dns.exe --set-master example.com |
|
|
Sets the Plesk name server as a secondary server for domain’s or domain alias’ DNS zone. |
To set the Plesk name server as a secondary server for DNS zone on the domain example.com: plesk bin dns.exe --set-slave example.com |
|
|
Updates the SOA record settings for domain’s or domain alias’ DNS zone. |
To set the TTL value for the SOA record of the DNS zone on the domain example.com to 5 hours: plesk bin dns.exe --update-soa example.com -soa-ttl 5H |
|
|
Displays the list of resource records for a domain’s or domain alias’ DNS zone. |
To view the list of resource records in the DNS zone for the domain example.com: plesk bin dns.exe --info example.com |
|
Displays help on the use of the utility. |
To view help on the use of the plesk bin dns.exe --help or plesk bin dns.exe -h |
Options
Option |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Specifies the Used with the Requires the |
To add an plesk bin dns.exe -a example.com -a sample -ip 192.0.2.78 To add an plesk bin dns.exe -a example.com -a sample -ip 2001:db8:85a3:0:0:8a2e:370:7334 |
|
|
Specifies the Used with the Requires the |
|
|
|
Specifies an IP address for creating an Used with the |
|
|
|
Specifies the Used with the Requires the |
To add an plesk bin dns.exe -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 the |
To add a plesk bin dns.exe -a example.com -mx mail3 -mailexchanger mail.example.com -priority 15 |
|
|
Specifies the HTTPS DNS record in a domain’s DNS zone. Used with the Requires the |
To add an HTTPS DNS record for the domain plesk bin dns.exe --add example.com -https "" -https-priority 1 -https-protocols h3,h2 To add an HTTPS DNS record for the domain plesk bin dns.exe --set example.com -list "NS,,ns1.example.com.;A,ns1,192.0.2.1;HTTPS,service,example.com. alpn=h3\,h3-29 no-default-alpn port=8443 ipv4hint=192.0.2.1 ipv6hint=2001:db8:85a3::8a2e:370:7334\,2001:db8:85a3::8a2e:370:7335,1" |
|
|
Specifies the name of a mail exchanger for creating an |
|
|
|
Specifies the mail exchanger priority (0 - the highest, 50 -
the lowest) for creating an |
|
|
|
Specifies the Used with the Requires the |
To add a plesk bin dns.exe --add example.com -cname sample -canonical example.org |
|
|
Specifies a canonical name for creating a |
|
|
|
Specifies the Used with the Requires the |
To add a plesk bin dns.exe -a example.com -ptr sample -subnet 192.0.2.1/16 |
|
|
Specifies an IP address and a subnet mask for creating a
|
|
|
|
Specifies the SRV type resource record in a domain’s DNS zone. Used with the Requires the use of options
|
To add an SRV record to make domain example.com handle SIP protocol connections, that will point to a server named sipserver.sample.com listening on TCP port 5060. The priority given here is 0, and the weight is 5: plesk bin dns.exe --add example.com -srv "" -srv-service sip -srv-target-host sipserver.sample.com. -srv-protocol TCP -srv-port 5060 -srv-priority 0 -srv-weight 5 |
|
|
Specifies priority of the SRV record (0 - the highest, 50 - the lowest). |
|
|
|
Specifies relative weight of the SRV record among records with the same priority (0 - the lowest, 50 - the highest). |
|
|
|
Specifies the port on which the service is to be found (for SRV record). |
|
|
|
Specifies canonical hostname of the machine providing the service (for SRV record). |
|
|
|
Specifies the service protocol for SRV record. |
|
|
|
Specifies symbolic name of the service for SRV record. |
|
|
|
Specifies the Used with the Requires the |
To specify the plesk bin dns.exe -a example.com -txt "This record is used to implement the Senders Policy Framework and DKIM specifications" -domain sample |
|
|
Specifies IP address for creating AXFR record. |
|
|
|
Specifies a subdomain name for creating a Used with the |
|
|
|
Enables/Disables support of the www-prefixed alias for a canonical domain name in a domain’s DNS zone. Used with the Creates/Deletes a |
To enable support of the www-prefixed alias www.example.com (pointing to domain example.com) in the DNS zone on the domain example.com: plesk bin dns.exe -res example.com -www true -ip 192.0.2.94 |
|
|
Adds an IP address of a primary DNS server for a domain’s DNS zone. Used with the |
To add the IP address 192.0.2.78 of the primary DNS server for DNS zone on the domain example.com: plesk bin dns.exe -a example.com -primary 192.0.2.78 |
|
|
Sets the TTL value for the SOA record of a domain’ or domain alias’ DNS zone. 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 DNS zone on the domain example.com: plesk bin dns.exe --update-soa example.com -soa-ttl 5H -soa-refresh 4H -soa-retry 10S -soa-expire 2W -soa-minimum 2D |
|
|
Sets the Refresh value for the SOA record of a domain’ or domain alias’ DNS zone. Used with the |
|
|
|
Sets the Retry value for the SOA record of a domain’ or domain alias’ DNS zone. Used with the |
|
|
|
Sets the Expire value for the SOA record of a domain’ or domain alias’ DNS zone. Used with the |
|
|
|
Sets the Minimum value for the SOA record of a domain’ or domain alias’ DNS zone. Used with the |
|
|
|
Specifies format of SOA record serial number: UNIX timestamp or recommended by IETF and RIPE. Used with the |
To change the SOA record serial format to recommended by IETF and RIPE for domain example.com: plesk bin dns.exe --update-soa example.com -soa-serial-format yyyymmddnn |
|
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 the domain example.com, while removing all pre-existing resource records from the DNS zone:
|
|
|
Specifies the priority of the created HTTPS DNS record (0 - the highest, 50 - the lowest). The priority is applied if multiple HTTPS records are available for the same domain name. |
To add an HTTPS DNS record for the domain plesk bin dns.exe --add example.com -https "" -https-priority 1 -https-protocols h3,h2 |
|
|
Specifies the target port for the HTTPS DNS record. |
To add an HTTPS DNS record for the domain plesk bin dns.exe --add example.com -https "" -https-priority 1 -https-protocols h3,h2 -https-target-port 8443 |
|
|
Specifies the target host for the HTTPS DNS record. An empty value means the host is the same as the domain name. |
To add an HTTPS DNS record for the domain plesk bin dns.exe --add example.com -https "" -https-priority 1 -https-protocols h3,h2 -https-target-host cdn.example.com |
|
|
Specifies a comma-separated list of protocols supported by the server for the HTTPS DNS record. |
To add an HTTPS DNS record for the domain plesk bin dns.exe --add example.com -https "" -https-priority 1 -https-protocols h3,h3-29,h2,http/1.1 |
|
|
Forces to use only the specified protocols for the HTTPS DNS record. Requires the |
To add an HTTPS DNS record for the domain plesk bin dns.exe --add example.com -https "" -https-priority 1 -https-protocols h3,h3-29 -https-force-protocols true |
|
|
Specifies a comma-separated list of IPv4 addresses that can be used by a client to reach the service for the HTTPS DNS record. |
To add an HTTPS DNS record for the domain plesk bin dns.exe --add example.com -https "" -https-priority 1 -https-protocols h3,h2 -https-ipv4-hint 192.0.2.1 |
|
|
Specifies a comma-separated list of IPv6 addresses that can be used by a client to reach the service for the HTTPS DNS record. |
To add an HTTPS DNS record for the domain plesk bin dns.exe --add example.com -https "" -https-priority 1 -https-protocols h3,h2 -https-ipv6-hint 2001:db8:85a3::8a2e:370:7334 |