Domain Is Not Created because of Existing DNS Records in psa Database

Created:

2016-11-16 13:20:16 UTC

Modified:

2017-04-26 13:20:06 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Domain Is Not Created because of Existing DNS Records in psa Database

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Linux
  • Plesk 12.5 for Windows

Symptoms

  • Migration failed with the following error

    Warning: hosting "example.com"
    Failed deployment of domain
    Warning:
    Execution of /usr/local/psa/admin/plib/api-cli/domain.php --create example.com -webspace-name example.com -do-not-apply-skeleton -notify false -guid UID -creation-date 2013-01-01 -parent-domain-name example.com -skip-plan -ignore-nonexistent-options failed with return code 1.
    Stderr is
    An error occurred during domain creation: unable to set domain name: Unable to create the domain example.com because a DNS record pointing to the host example.com already exists.
  • Unable to create a domain, the following error appears

    This DNS record already exists.

Cause

There is no such domain as example.com in Plesk, but at least one DNS record related to the domain exists in the Plesk database.

Resolution

Only for Linux:

Run the following command in shell:

    /usr/local/psa/bin/dns --del-all domain.tld

In general the command above checks content of domains and domain_aliases tables. In case they do not contain data about specified domain, you can use the following steps to fix this issue:

For Both OS types:

  1. Check this domain in the psa.dns_zone , psa.dns_recs , dns_refs .

    mysql> select id,name from dns_zone where name="example.com";
    +----+-------------+
    | id | name |
    +----+-------------+
    | 9 | example.com |
    +----+-------------+
    1 row in set (0.00 sec)

    mysql> select count(*) from dns_recs where dns_zone_id=9;
    +----------+
    | count(*) |
    +----------+
    | 11 |
    +----------+
    1 row in set (0.00 sec)

    mysql> select count(*) from dns_refs where zoneId=9;
    +----------+
    | count(*) |
    +----------+
    | 10 |
    +----------+
    1 row in set (0.00 sec)
  2. Create dump of psa database:

    Plesk 11.5\12 for Linux:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin psa > /tmp/psa.`date +%F`

    Plesk 12.5 for Linux :

    plesk db dump psa > /tmp/psa.`date +%F`

    Plesk 12.5 for Windows :

    plesk db dump psa > C:\\psa.dump.sql
  3. Delete records if they are there:

    mysql > delete from dns_zone where name="example.com";
    mysql > delete from dns_refs where zoneId=9;
    mysql > delete from dns_recs where dns_zone_id=9;
Have more questions? Submit a request
Please sign in to leave a comment.