Create a backup of the psa-database:
Code:
mysqldump -uadmin -p`cat /etc/psa/.psa.shadow ` psa > /tmp/psa.`date +%F_%H.%M`.sql
Find the domains whose DNS zones prevent the IP address from being deleted:
Code:
mysql> set @ip_address := '101.10.10.10';
mysql> select d.name as DomainName, dnsr.type, dnsr.host, dnsr.id as DNS_record_ID from domains as d join dns_recs as dnsr on d.dns_zone_id=dnsr.dns_zone_id where dnsr.val=@ip_address;
For each domain shown in the issue, go to Plesk> Domains> example.com> Manage Hosting> Sites & Domains> DNS Settings and remove the related entry.
If the domain does not exist in Plesk, manually delete the entry from the output using the associated value of the DNS_record_ID.
For example, if example.com does not exist:
Code:
+-------------------------------+------+----------------------------------------+---------------+
| DomainName | type | host | DNS_record_ID |
+-------------------------------+------+----------------------------------------+---------------+
| test.tld | A | mail.test.tld. | 358 |
| example.com | A | mail.example.com. | 134 |
...then call the following command (be careful not to delete entries for active domains):
Code:
mysql> delete from dns_recs where id=134;
If the issue has occurred after switching to a new IP with all subscriptions, the DNS records may not have been updated properly. In this case, you can search for the non-updated entries in the dns_recs table:
Code:
mysql> SELECT * from `dns_recs` WHERE `val` = '<old_ip>';
Before the IP can be deleted, all of these entries must be updated (the old IP in val must be changed to something else).
To correct the visual representation (in the Plesk web interface), you may need to start the following query:
Code:
mysql> UPDATE `dns_recs` SET `displayVal` = `val` WHERE `val` <> `displayVal`;
If you have any further questions, let me know.