Plesk

How to add or modify DNS records for specific domain using CLI in Plesk for Linux

Question

How to add or modify DNS records for the specific domain using CLI?

Answer

  1. Connect to the server using SSH.

    Note: If direct SSH access to the server is not possible, contact server administrator for further assistance.

  2.  Use the following command to add a DNS record for the domain example:

    # plesk bin dns --add example.com -srv sub.example.com -srv-service sip -srv-target-host sipserver.example.com -srv-protocol tcp -srv-port 5060 -srv-priority 0 -srv-weight 5

    where

    • example.com - domain to which the DNS record needs to be added.

    • -srv - type of DNS record.

    • -srv-service sip -srv-target-host sipserver.example.com -srv-protocol tcp -srv-port 5060 -srv-priority 0 -srv-weight 5 - additional parameters for specific DNS record type.

Other examples:

For other options and examples of using the CLI utility dns, see the following documentation article in Reference for Command-Line Utilities, Plesk for Linux: dns: DNS Zones on Domains