Unable to remove an IP address from Tools & Settings > IP Address: IP address cannot be removed because it is used by DNS zone of one or more domains

Refers to:

  • Plesk 12.5 for Linux
  • Plesk 10.4 for Linux
  • Plesk Onyx for Linux
  • Plesk 11.0 for Windows
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Windows
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Windows
  • Plesk 12.0 for Linux
  • Plesk 12.5 for Windows
  • Plesk 9.x and below for Linux

Created:

2016-11-16 12:52:21 UTC

Modified:

2017-02-19 00:15:08 UTC

2

Was this article helpful?


Have more questions?

Submit a request

Unable to remove an IP address from Tools & Settings > IP Address: IP address cannot be removed because it is used by DNS zone of one or more domains

Symptoms

It is not possible to delete an IP address from Tools & Settings > IP Address .

The following error is shown:

Error: IP address <ip> cannot be removed because it is used by DNS zone of one or more domains

Cause

This issue is caused by an inconsistency in the psa database.

Resolution

  1. Create a backup of the current psa database:

    Windows: "%plesk_dir%\\MySQL\\bin\\mysqldump.exe" -uadmin -P8306 -p<PleskPasswordHere> psa > c:\\psadump.sql

    Linux: mysqldump -uadmin -p`cat /etc/psa/.psa.shadow ` psa > /tmp/psa.`date +%F_%H.%M`.sql
  2. Find the domains whose DNS zones prevent the IP address from being deleted:

    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;
  3. For each domain shown in the output, go to Parallels Plesk Panel > Domains > example.com > Manage hosting > Websites & Domains > DNS Settings and remove the corresponding record.

    If the domain does not exist in Parallels Plesk Panel, delete the record manually using the corresponding DNS_record_ID value from the output.

    For example, if example.com does not exist:

    +-------------------------------+------+----------------------------------------+---------------+
    | DomainName | type | host | DNS_record_ID |
    +-------------------------------+------+----------------------------------------+---------------+
    | test.tld | A | mail.test.tld. | 358 |
    | example.com | A | mail.example.com. | 134 |

    ...then run the following command ( make sure you are not deleting any records for active domains ):

    mysql> delete from dns_recs where id=134;

If the issue appeared after switching all subscriptions to a new IP, DNS records may have not been updated properly. In this case, you can look up the outdated entries in the dns_recs table:

mysql> SELECT * from `dns_recs` WHERE `val` = '<old_ip>';

All of them need to be updated (the old IP in val should be changed to something else) before this IP can be deleted.

To fix visual representation (in the Plesk web interface), you may need to execute the following query:

mysql> UPDATE `dns_recs` SET `displayVal` = `val` WHERE `val` <> `displayVal`;
Have more questions? Submit a request
Please sign in to leave a comment.