Articles in this section

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

kb: how-to Plesk for Linux ABT: Group B

Applicable to:

  • 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:

  • To create an A record for the domain example.com:

    # plesk bin dns -a example.com -a "" -ip 203.0.113.2

  • To delete an A record for the domain example.com:

    # plesk bin dns -d example.com -a "" -ip 203.0.113.2

  • To create NS record for the domain example.com:

    # plesk bin dns -a example.com -ns "" -nameserver ns1.example.com

  • To create PTR record:

    # plesk bin dns --set example.com -list “PTR,203.0.113.2,,24.;”

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

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.