Pre-requirements
- Access to the Plesk control panel as an administrator.
- The domain DNS settings need to be accessible for modification.
- Basic knowledge of DNS records, specifically NS (Name Server) records.
Issue
When attempting to manually add a DNS record to a domain in Plesk, you may encounter the following error:
Cannot delete the last NS DNS record for the domain.
Cause
This issue arises because the domain either has missing or incorrect NS records. A common mistake is using an IP address as the value for an NS record instead of a proper hostname.
Resolution
To fix this issue, you need to correct the NS records. Follow the steps below for both single-domain fixes and server-wide corrections.
Steps to Correct the NS Records for a Single Domain
- Log into your Plesk control panel.
- Go to Domains > example.com > Hosting & DNS > DNS Settings.
- Ensure that the NS records point to valid DNS server hostnames.
- If the records are incorrect or missing, create new NS records with the correct DNS servers.
- Click Update to apply the changes.
- Attempt to add the DNS records that were previously failing.
Steps to Correct NS Records Server-Wide
- Log into your Plesk control panel as an admin.
- Navigate to Tools & Settings > DNS Template.
- Modify the template to ensure that all domains use the correct NS records globally.
- Apply the changes, which will update all domains on the server.
Gotchas to Avoid
- Do not use IP addresses as values for NS records. Only hostnames are valid.
- Ensure that you have valid, registered DNS servers for your NS records.
Linux Command to Check NS Records
dig NS example.com