Skip to content

DNS takedown checklist — decommissioning a domain or nameserver cleanly

Retiring a domain or a nameserver needs more than deleting the zone. Here is the checklist that catches the references you forgot — registrar, glue, downstream.

A customer’s contract ends. Their domains move to a different provider. The team deletes the cPanel accounts, removes the zone files, and considers the job done. Three weeks later, an unrelated customer’s cert renewal fails because the zone for an internal name in the deleted domain was still being queried — a dangling reference somewhere. Decommissioning DNS isn’t a single delete. It’s a checklist.

What’s happening

A retired domain has fingerprints in many places:

  • The cPanel host’s /var/named/example.com.db (the obvious one).
  • /etc/userdomains, /etc/userdatadomains, /var/cpanel/userdata/<user>/example.com.
  • Cluster peers’ copies of the same zone.
  • Internal references from other zones (a CNAME from app.othercustomer.com to something.example.com that nobody remembers).
  • Registrar records — NS at the registrar still points to your nameservers, even if the zone is gone.
  • Glue at the registrar, if the domain’s nameservers were named under it.
  • Downstream DNS — anyone with a zone CNAME’d or NS’d at the domain.
  • Reverse DNS — PTR records published by the IP provider mentioning the domain’s hostnames.
  • Cert issuance — if you decommission a domain whose zone hosts the _acme-challenge for another domain (rare but possible), cert renewals break.
  • Customer-side software — config files, monitoring scripts, IT inventory still pointing at hostnames in the dead domain.

Missing one of these leaves a “ghost zone” — partially decommissioned, with some queries succeeding and others failing.

How to verify

Before takedown, audit references:

# what else points to this domain?
for zone in /var/named/*.db; do
  grep -l example.com "$zone" 2>/dev/null
done

# what does the registrar still say?
whois example.com | grep -iE 'name server|status'

# any A or CNAME in other zones pointing here?
for zone in /var/named/*.db; do
  grep -E 'IN +(A|CNAME).*example\.com' "$zone"
done

After takedown, confirm:

# the zone should be gone
ls /var/named/example.com.db 2>/dev/null
named-checkconf | grep example.com

# external queries should NXDOMAIN
dig +short example.com @1.1.1.1

What to do

The takedown checklist:

  1. Confirm the customer truly wants the domain decommissioned vs transferred. Transferred domains move to a new registrar/host; decommissioned domains are released and may be re-registered by anyone. Document the customer’s choice in writing.
  2. Inventory in-scope zones and references. Use the audit commands above. Note any cross-zone references to handle.
  3. Update NS at the registrar. If the domain is being transferred to a new host, update NS to the new host’s nameservers. If decommissioning entirely, decide — leave NS pointing at your nameservers (and the zone resolves to whatever you’ll serve, typically NXDOMAIN once removed), or remove the domain from the registrar (which means it expires and re-enters the registration pool).
  4. Wait for the NS TTL to expire before removing the zone from your host. Otherwise resolvers still cached at the old NS keep querying your host, which will SERVFAIL for the removed zone — better than NXDOMAIN at this stage (it indicates “still looking up”), but you can avoid the noise by removing only after the cache window.
  5. Remove the zone from each cluster node. WHM > DNS Functions > Delete a DNS Zone (per zone, per node), or whmapi1 deletednszone domain=example.com on the master with cluster sync handling peers.
  6. Update cross-zone references. Any CNAME or A in other zones that pointed to the removed domain’s names. Replace, or remove the reference.
  7. Remove the cPanel account if the domain was the primary. WHM > Account Functions > Terminate an Account. This also removes user files, mail, and database privileges.
  8. Update PTR records if any of the cPanel host’s IPs had reverse DNS mentioning the domain. Contact the IP provider.
  9. Notify downstream customers who had records pointing to the domain. This is the easiest step to skip and the most likely to bite later. A spreadsheet of “who CNAMEs or NSs to anything in this zone” is the takeaway.
  10. Set a forwarding period for mail and HTTP if the customer requested it. A 90-day forward from @example.com to a new address gives stragglers time to update. This requires the zone to keep resolving for the duration, with MX still pointing somewhere.
  11. After the forwarding period, do a final removal sweep. Run the audit commands again; anything still resolving needs explanation.
  12. Archive the customer’s data as per your retention policy. Zone files, mail spool, web content. Don’t delete from the customer’s last backup before they confirm receipt.

For nameserver decommissioning (retiring a slave host without retiring the zones), the order:

  1. Remove the slave’s hostname/IP from each zone’s NS records.
  2. Wait for NS TTL.
  3. Remove glue at the registrar for the slave’s hostname (if any).
  4. Wait for glue TTL.
  5. Remove the slave from the cluster.
  6. Decommission the slave host.

Stack Harbor decommissions domains and nameservers with the full checklist as part of migration solutions.