Applicable to:
- Plesk for Linux
- Plesk for Windows
Symptoms
-
When creating a new domain/subdomain/alias, migrating an existing domain/subdomain or activating the mail service for a domain, the operation fails with one of the following errors:
PLESK_ERROR: DNS records for domain with such name already exist
OR
PLESK_ERROR: The subdomain with such name already exists
OR
PLESK_ERROR: This DNS record already exists
OR
PLESK_ERROR: Unable to create the subdomain test.example.com. because a DNS record pointing to the host test.example.com. already exists.
OR
PLESK_ERROR: Unable to set up the domain alias example.net because a DNS record pointing to the host example.net already exists.
-
On attempt to apply the changes to DNS template at Tools & Settings > DNS Template > Apply DNS Template Changes, the operation fails with the following error message:
PLESK_WARN: There were issues syncing DNS zones with the DNS zone template.
Unable to resolve dns zone owner -
The following error message appears in
/var/log/plesk/panel.log
:CONFIG_TEXT: ERR [panel] Unable to synchronize DNS zone [6] example.com: Unable to resolve dns zone owner
Cause
Orphaned DNS records exist in the Plesk database.
Resolution
-
Connect to the Plesk server via SSH.
-
Create a database dump of the Plesk database (for more information, see this KB article):
# plesk db dump psa > /root/psa_backup.sql
-
Access the Plesk database:
# plesk db
-
Find
dns_zone_id
of the domain, which cannot be created, using the following command. Replace example.com with an actual domain name:MYSQL_LIN: mysql> select dns_zone_id,host from dns_recs where host like "%example.com%";
+-------------+---------------------+
| dns_zone_id | host |
+-------------+---------------------+
| 3 | www.example.com. |
| 3 | example.com. |
| 3 | ns2.example.com. |
| 3 | ns1.example.com. |
| 3 | example.com. |
| 3 | ftp.example.com. |
| 3 | example.com. |
| 3 | example.com. |
| 3 | _dmarc.example.com. |
| 3 | example.com. |
| 3 | mail.example.com. |
| 3 | ipv4.example.com. |
+-------------+---------------------+ -
Using
dns_zone_id
from the output above, make sure that the domain name is the same:Note: In some cases the output may be empty.
MYSQL_LIN: mysql> select id,name from dns_zone where id=3;
+----+-------------+
| id | name |
+----+-------------+
| 3 | example.com |
+----+-------------+ -
Delete records from corresponding tables using the ID from the steps above:
MYSQL_LIN: mysql> delete from dns_zone where id=3;
mysql> delete from dns_recs where dns_zone_id=3;
mysql> delete from dns_refs where zoneId=3; -
Create the domain/subdomain/alias in Plesk / Rerun the migration.
-
Connect to the Plesk server via RDP.
-
Create a database dump of the Plesk database (for more information, see this KB article):
C:\> plesk db dump psa > C:\psa_backup.sql
-
Access the Plesk database:
C:\> plesk db
-
Find
dns_zone_id
of the domain, which cannot be created, using the following command. Replace example.com with an actual domain name:MYSQL_WIN: mysql> select dns_zone_id,host from dns_recs where host like "%example.com%";
+-------------+---------------------+
| dns_zone_id | host |
+-------------+---------------------+
| 3 | www.example.com. |
| 3 | example.com. |
| 3 | ns2.example.com. |
| 3 | ns1.example.com. |
| 3 | example.com. |
| 3 | ftp.example.com. |
| 3 | example.com. |
| 3 | example.com. |
| 3 | _dmarc.example.com. |
| 3 | example.com. |
| 3 | mail.example.com. |
| 3 | ipv4.example.com. |
+-------------+---------------------+ -
Using
dns_zone_id
from the output above, make sure that the domain name is the same:Note: In some cases the output may be empty.
MYSQL_WIN: mysql> select id,name from dns_zone where id=3;
+----+-------------+
| id | name |
+----+-------------+
| 3 | example.com |
+----+-------------+ -
Delete records from corresponding tables using the ID from the steps above:
MYSQL_WIN: mysql> delete from dns_zone where id=3;
mysql> delete from dns_recs where dns_zone_id=3; -
Create the domain/subdomain/alias in Plesk / Rerun the migration.
Comments
3 comments
How to solve probleme if no ssh access?
@cit dev
SSH is mandatory in this case because Plesk database cannot be accessed via GUI. Please contact your server provider in order to solve it.
Ok thanks!
Please sign in to leave a comment.