Overview
This article provides a comprehensive guide to troubleshooting and resolving the issue of being unable to delete an IP address from Plesk due to DNS record conflicts. It outlines the necessary steps, pre-requirements, and best practices for effective IP address management.
Pre-requirements
- Access to a Plesk server with administrative privileges.
- Basic understanding of DNS records and database management.
- Familiarity with using the command line interface (CLI) for Linux.
Identifying the Issue
If you encounter the error message stating that an IP address cannot be removed because it is used by the DNS zone of one or more domains, follow these steps to identify the conflicting records:
# Connect to the Plesk database
plesk db
# Query to find the DNS records using the IP address
mysql select * from dns_recs where val='203.0.113.2' or displayVal='203.0.113.2';
Resolving the Conflict via Plesk Panel
- Log into Plesk:
Access your Plesk control panel by entering your credentials.
- Navigate to DNS Settings:
Go to Domains -> example.com -> DNS Settings.
- Modify Individual DNS Records:
For each DNS record that is using the incorrect IP address:
- Click on the required record.
- Alter the IP Address field.
- Submit the changes by pressing OK.
- Confirm the changes by clicking the Update button on the DNS Settings screen.
- Apply DNS Template for All Records:
If multiple records need to be updated, click on the Apply DNS Template button to apply the changes across all records.
Resolving the Conflict via Linux CLI
- Connect to the Server:
Use SSH to connect to your server:
ssh user@your-server-ip
- Create a Backup of the Plesk Database:
To create a backup, run the following command:
plesk db dump > plesk_backup.sql
- Access the Plesk Database:
Enter the MySQL command line:
plesk db
- Update Incorrect DNS Records:
Run the following commands to update the DNS records:
# Update displayVal for the incorrect IP address UPDATE dns_recs SET displayVal = '10.39.91.111' WHERE displayVal = '203.0.113.2'; # Update val for the incorrect IP address UPDATE dns_recs SET val = '10.39.91.111' WHERE val = '203.0.113.2';
Gotchas to Avoid
- Database Backup: Always back up your database before making direct changes to avoid data loss.
- Verify IP Addresses: Double-check that you are updating the correct IP addresses to prevent misconfigurations.
- Propagation Time: Be aware that changes may take time to propagate across the DNS system.
This guide outlines the steps to troubleshoot and resolve issues related to deleting an IP address in Plesk due to DNS record conflicts. By following these procedures and best practices, you can effectively manage your IP addresses and avoid related issues in the future.