# Turn off DNSSEC

Stop signing a hosted zone safely once the registrar no longer serves its DS record, or at once.

Replace _zone-id_ with the id of your signed hosted zone.

**Warning:**
A resolver that still holds the zone's DS rejects unsigned answers. Stopping at once while the
parent serves the DS makes the zone fail to resolve at validating resolvers until the DS is gone
from the parent and from their caches.

## Prerequisites

- Permission for `dns:DisableDnssec` on the zone; to keep signing after all, `dns:EnableDnssec`.
- In the console, also `dns:ListZones` to open **Hosted zones** (without it the page shows an
  access-denied notice), `dns:GetZone` to open the zone (without it the zone's page is not found)
  and `dns:GetDnssec` to see the **DNSSEC** tab (without it the tab says "Seeing this zone’s DNSSEC
  keys needs dns:GetDnssec on it. Ask an administrator.").
- Remove the zone's DS record at the registrar first.

## Turn signing off

**Console**
1. Open the zone, then choose the **DNSSEC** tab.
2. Under **Signing**, choose **Disable DNSSEC**.
3. (Optional) Under **Signing**, choose **Stop signing now** to stop without waiting, or **Keep
   signing** to change your mind.

After step 2 the console says "Disabling: the zone stays signed until the parent no longer serves
the DS." and **Chain of trust** reads "Disabling: still signed until the parent stops serving the
DS". **Stop signing now** says "The zone is served unsigned."; **Keep signing** says "Signing again
with the same keys."

**CLI**
```sh
dcloud dns dnssec disable zone-id
```

To stop at once: `--immediately`.

**API**
```http
POST /dns/api/zones/zone-id/dnssec/disable
{}
```

To stop at once:

```http
POST /dns/api/zones/zone-id/dnssec/disable
{ "immediately": true }
```

**Terraform**
Remove the `dcloud_dns_zone_dnssec` resource and run `terraform apply`. This starts disabling; it
does not stop at once.

## Result

Without "immediately", the zone's DNSSEC status is `disabling`. The platform keeps asking public
resolvers (1.1.1.1 and 8.8.8.8) for the zone's DS. Once both return none, the zone stays signed for
about one more hour (the console shows "unsigned from" that time), and is then served unsigned with
its keys removed. While the parent still serves a DS, the zone stays signed, and a DS that comes
back cancels the "unsigned from" time.

With "immediately", the keys are removed and the zone is served unsigned from the nameservers' next
pull.

To keep signing while the status is `disabling`, choose **Keep signing** or enable DNSSEC again:
the zone keeps its keys and its DS. After the keys are removed, enabling creates new keys with a
new DS.

`409` "DNSSEC is not on for this zone" when its DNSSEC status is `off`. Disabling a zone that is
already `disabling` again clears its "unsigned from" time, so the hour starts over at the next
check; with "immediately" it stops signing at once.

## Related

- [Sign a zone with DNSSEC](sign-a-zone-with-dnssec.md)
- `dns.dnssec.disable` · `dcloud dns dnssec disable` · `dcloud_dns_zone_dnssec`
