Articles in this section

Unable to create a domain alias in Plesk: DNS record already exists

kb: technical Plesk Onyx for Linux ABT: Group B

Applicable to:

  • Plesk Onyx for Linux

Symptoms

When creating a new domain alias, the operation fails with the following error message in Plesk (in this example, domain alias example.net for example.com):

PLESK_ERROR: Error: Unable to add the ipv4.example.net. IN A 203.0.113.2 record to zone example.net: DNS record already exists.

Cause

The domain, for which a domain alias is created, contains duplicate DNS records.

In this example, there is a duplicate DNS entry for example.com that points to the same IP address 203.0.113.2 at Domains > example.com > DNS Settings.


Screenshot_2018-12-24_The_Plesk_s_DNS_server_acts_as_a_primary_name_server_for_the_DNS_zone_example_com_-_Plesk_Onyx_17_8_11.png

Resolution

  1. Log in to Plesk.

  2. Go to Domains > example.com > DNS Settings.

  3. Select the duplicate DNS entries and remove them.

    Note: If the domain's DNS zone is hosted externally (only NS records are shown), see the solution below.


    Screenshot_2018-12-24_The_Plesk_s_DNS_server_acts_as_a_primary_name_server_for_the_DNS_zone_example_com_-_Plesk_Onyx_17_8_11.png

  4. On the next page, click Update to apply the changes.

 

If the domain's DNS zone is hosted externally (only NS records are shown):

  1. Connect to your Plesk server via SSH.

  2. For safety reasons, create a backup of the Plesk system database:

    # plesk db psa > /root/psa_dump.sql

  3. Access Plesk database:

    # plesk db

  4. List duplicated entry mentioned in the error message for domain example.com (for which alias domain should be created):

    MYSQL_LIN: MariaDB [psa]> select * from dns_recs where host='example.com.' and type='A'\G
    *************************** 1. row ***************************
    time_stamp: 2025-03-14 17:58:57
    id: 83
    dns_zone_id: 2
    type: A
    host: ipv4.example.com.
    displayHost: ipv4.example.com.
    val: 203.0.113.2
    displayVal: 203.0.113.2
    opt:
    external_id:
    ttl: NULL
    *************************** 2. row ***************************
    time_stamp: 2025-03-14 17:58:57
    id: 96
    dns_zone_id: 2
    type: A
    host: ipv4.example.com.
    displayHost: ipv4.example.com.
    val: 203.0.113.2
    displayVal: 203.0.113.2
    opt:
    external_id:
    ttl: NULL

  5. Delete the extra record using its ID:

    MYSQL_LIN: MariaDB [psa]> DELETE FROM dns_recs WHERE id = 96;

 

 

Was this article helpful?

Comments

1 comment
Date Votes
  • This error can occur if DNS for the (sub)domain is disabled.  Enable DNS, delete the A and/or AAAA records, and disable DNS again.

    0

Please sign in to leave a comment.