Delete a hosted zone
Delete a hosted zone with every record set and DNSSEC key in it.
Replace zone-id with the id of the zone, and example.com with its domain.
Warning
A zone is removed at once and cannot be restored. Every record set goes with it, including the
ALIAS records the platform wrote for your apps' custom domains. If the domain still delegates to
the platform nameservers, it stops resolving: they answer REFUSED for it.
Prerequisites
- Permission for
dns:DeleteZone. Without it, Delete zone is unavailable, with the note "Your policies do not grant dns:DeleteZone on this zone; ask an administrator." - In the console, also
dns:ListZonesto open Hosted zones (without it the page shows an access-denied notice) anddns:GetZoneto open the zone (without it the zone's page is not found). - If the domain should keep resolving: move it to another DNS host first, and change the nameservers at the registrar. Export the records to take them along (see Import or export a zone file). If the zone is signed, remove its DS record at the registrar first (see Turn off DNSSEC).
Delete the zone
- Open the zone, then choose the Danger zone tab (or, in the ⋯ menu, Delete zone).
- Under Delete this zone, choose Delete zone.
- In the dialog, enter example.com, then choose Delete.
The console returns to Hosted zones. If the delete fails, the reason appears under Delete this zone, after "The zone was not deleted:".
dcloud dns zones delete zone-idDELETE /dns/api/zones/zone-idThe answer is 200 with the zone's id, or 404 "Zone not found".
Remove the dcloud_dns_zone resource and run terraform apply.
Result
The zone, its record sets, its DNSSEC keys and its query-logging setting are gone. The domain is free again for anyone to host.