Articles in this section

Unable to update the DNS zone for a domain after adding a record in Plesk: Cannot delete the last NS DNS record for the domain

Plesk for Windows Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

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:

    PLESK_ERROR: 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:

    CONFIG_TEXT: [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
  1. Log into Plesk
  2. Go to Domains > example.com > Hosting & DNS > DNS Settings
  3. Create NS records for the domain with the desired DNS servers
  4. Press Update
  5. 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
  1. Log into Plesk
  2. Go to Tools & Settings > DNS Settings
  3. 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
  4. Press Apply DNS Template Changes
Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.