Symptoms
-
When attempting to add a DNS record to a domain manually, the following error appears in the Plesk GUI after clicking Update to apply the changes to the DNS zone of the related domain:
Cannot delete the last NS DNS record for the domain.
-
When attempting to generate a wildcard SSL certificate for a domain, the
_acme-challenge
TXT record is never created and the following error can be found in/var/log/plesk/panel.log
after activating debug mode:[2023-01-03 21:20:27.961] 3399:63b48e02d955f DEBUG [panel] Protocol version: 1.6.9.1
[2023-01-03 21:20:27.988] 3399:63b48e02d955f DEBUG [panel] run operator dns
[2023-01-03 21:20:28.007] 3399:63b48e02d955f DEBUG [api-rpc/letsencrypt] API-RPC response [cef3b659fd9b1ed66cf0ba6f7caa5b38]:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.9.1">
<dns>
<add_rec>
<result>
<status>error</status>
<errcode>1019</errcode>
<errtext>Cannot delete the last NS DNS record for the domain.</errtext>
</result>
</add_rec>
</dns>
</packet>
Cause
The domain has missing or incorrect NS records (such as having an IP as value instead of a hostname).
Resolution
Correct the NS records for a single domain
- Log into Plesk
- Go to Domains > example.com > Hosting & DNS > DNS Settings
- Create NS records for the domain with the desired DNS servers
- Press Update
- Create the new records that previously failed to be added
Add the NS records to the server-wide DNS template in order to fix the NS records for all domains at once
- Log into Plesk
- Go to Tools & Settings > DNS Settings
-
Add NS records
- Create new records with the desired DNS (use ns1/ns2/ns3.<domain> for branded DNS)
- Press Reset to Default to restore Plesk's default DNS template
- Press Apply DNS Template Changes