Cannot add a new domain or migrate existing one: DNS record already exists

Created:

2016-11-16 12:50:12 UTC

Modified:

2017-04-24 11:04:06 UTC

4

Was this article helpful?


Have more questions?

Submit a request

Cannot add a new domain or migrate existing one: DNS record already exists

Applicable to:

  • Plesk

Symptoms

An attempt to create a new domain or migrate existing one fails and the following error is shown:

DNS records for domain with such name already exist

or

The subdomain with such name already exists

or

This DNS record already exists

Cause

A DNS record for the domain already exists in Plesk database, so a new domain with the same name cannot be added.

Resolution

Try to fix this error in automatic mode using Plesk repair utility that is available in Plesk 12.5 and Plesk Onyx:

plesk repair db

Note: Do not accept all the suggestions blindly.

If the issue persits, try finding a record with a similar name in the DNS settings of the existing domains.

  1. Backup Plesk database according to How to backup/restore a Plesk database dump?
  2. Open Plesk database:

    Linux:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa

    Windows:

    Refer to this article: #213928465 How to access Plesk database

  3. Run the following query to find the DNS record preventing the new domain creation (replace "example.com" with the real name of the domain you are trying to create)

    mysql> select * from dns_zone where displayname like '%example.com%'\G

    And remove found record using its ID:

    mysql> delete from dns_zone where id=<id_from_previous_select>; 

    Select all the records with desired domain name:

    mysql> select * from dns_recs where host like '%example.com%';

    Make sure that no any other domain is selected and remove these records:

    mysql> delete from dns_recs where host like '%example.com%';
  4. Try to create a domain again.
Have more questions? Submit a request
Please sign in to leave a comment.