Domains and DNS
DNSSEC
Switch DNSSEC on or off for a zone, read the DS record to publish at your registrar, check what public resolvers see and rotate the zone signing key.
These endpoints control the DNSSEC of one zone. The paths start with /v2/cdn/dnssec/{domain_public_id}/, where the id is the public id of the domain, taken from the domains list.
The examples on this page use these shell variables:
export DIAMWALL_API_KEY="your key"export DNSSEC="https://api.diamwall.com/v2/cdn/dnssec/your-domain-public-id"The order of calls
Section titled “The order of calls”Switching DNSSEC on takes four steps, and the last one is not done through this API:
- Read the settings and keep the
ETagheader of the answer. - Send
PATCHwith{ "enabled": true }and thatETaginIf-Match. - Take the DS record from
data.dsof the answer and publish it at your registrar. Neither the API nor the CDN publishes it for you. - Run the diagnostic until
data.statusisactive.
Settings
Section titled “Settings”Read the settings
Section titled “Read the settings”curl -i "$DNSSEC/settings/dnssec/" \ -H "Authorization: Api-Key $DIAMWALL_API_KEY"{ "revision": "sha256:9cb0a61e89b3...", "consistency": "verified", "publication": { "status": "verified", "rollout": "unknown" }, "data": { "enabled": { "state": "resolved", "value": true }, "keyset_complete": { "state": "resolved", "value": true }, "key_artifacts_present": { "state": "resolved", "value": true }, "private_keys_valid": { "state": "resolved", "value": true }, "ksk": { "state": "resolved", "value": { "ttl": 3600, "public_key": "EgoNVIUfWzWlGoSgI9Nc..." } }, "ds": { "state": "resolved", "value": { "ttl": 3600, "key_tag": 33519, "algorithm": 13, "algorithm_name": "ECDSAP256SHA256", "digest_type": 2, "digest_type_name": "SHA256", "digest": "CD491DBDCC608D79ACD01FC094D0AFC219DEB760CB36736C8715759E0A4F7DAB" } } }}data holds six fields:
| Field | What it says |
|---|---|
enabled |
Whether DNSSEC is on for the zone. |
keyset_complete |
Whether the keyset of the zone is complete. |
key_artifacts_present |
Whether the key artifacts of the zone are present. |
private_keys_valid |
Whether the CDN validated the private keys. It is a boolean. No private key material is ever answered. |
ksk |
The public key signing key: ttl and public_key, in base64. |
ds |
The DS record of that key: ttl, key_tag, algorithm, algorithm_name, digest_type, digest_type_name and digest. |
Each field comes back with a state, a reason when the CDN gives one, and a value only when state is resolved.
Three more things to know about this answer:
- The
ETagheader is the revision of the settings. Keep it for the next change. - When the settings could not be read at all, the answer has
"state": "unknown", arevisionofnull, nodataand noETag. There is nothing to send inIf-Match, so do not write. publication.rolloutis alwaysunknown. The answer does not prove anything about every point of presence.
Publish the DS record
Section titled “Publish the DS record”There is no ready-made DS line in the answer. Compose it from ttl, key_tag, algorithm, digest_type and digest, in the form your registrar asks for. With the values above, a zone file line looks like this:
example.com. 3600 IN DS 33519 13 2 CD491DBDCC608D79ACD01FC094D0AFC219DEB760CB36736C8715759E0A4F7DABThe DS record is answered whole or with no value. Publish only a ds whose state is resolved and that has its value. A DS record that is nearly right breaks the resolution of the whole zone.
Switch DNSSEC on or off
Section titled “Switch DNSSEC on or off”Read the settings first to get the ETag, then send it in If-Match exactly as it came, quotes included:
ETAG=$(curl -s -o /dev/null -D - "$DNSSEC/settings/dnssec/" \ -H "Authorization: Api-Key $DIAMWALL_API_KEY" \ | tr -d '\r' | awk 'tolower($1) == "etag:" { print $2 }')
curl -i -X PATCH "$DNSSEC/settings/dnssec/" \ -H "Authorization: Api-Key $DIAMWALL_API_KEY" \ -H "Content-Type: application/json" \ -H "If-Match: $ETAG" \ -d '{ "enabled": true }'- The body is exactly
enabled, a JSON boolean.trueswitches DNSSEC on,falseswitches it off. - A string, a number or
nullinenabledanswers400 INVALID_REQUESTwithenabledinfields. So does a missing body or any other field. - The answer has the same form as the read, with the settings as they are after the change, and a new
ETagheader for the next change. - After switching on, the DS record to publish is
data.dsof this answer, when it isresolvedand has itsvalue. If it is not, read the settings again.
Diagnostic
Section titled “Diagnostic”The settings tell you what is configured. The diagnostic tells you what the Google and Cloudflare public resolvers observe for the domain. It takes no query parameter and no body.
curl "$DNSSEC/diagnostics/dnssec/" \ -H "Authorization: Api-Key $DIAMWALL_API_KEY"{ "diagnostic": "dnssec", "data": { "status": "missing_ds", "reasons": ["parent_ds_absent"], "warnings": [], "coverage": "full", "checked_at": "2026-11-11T10:00:00.000Z", "cache": { "hit": false, "expires_at": "2026-11-11T10:00:30.000Z" }, "validation_basis": "trusted_resolver_ad_and_cd", "local": { "enabled": true, "keyset_complete": true, "consistency": "enabled_with_complete_keyset", "ds": { "ttl": 3600, "key_tag": 12345, "algorithm": 13, "digest_type": 2, "digest": "0123456789ABCDEF..." } }, "resolvers": [ { "id": "google", "available": true, "status": "missing_ds", "reasons": ["parent_ds_absent"] }, { "id": "cloudflare", "available": true, "status": "missing_ds", "reasons": ["parent_ds_absent"] } ] }}The example is shortened. Each available resolver also answers parent_ds and zone, with what it saw.
Use data.status as the global state. data.local.enabled is only the configuration switch.
data.status |
How to read it |
|---|---|
active |
DNSSEC works. This is the only value to show as active. |
missing_ds, ds_mismatch, disabled_with_ds, validation_failed |
A problem that both resolvers agree on. reasons holds the codes that say why. |
disabled |
DNSSEC is off. |
inconclusive |
The evidence is insufficient or inconsistent. Do not show the domain as broken. |
unrecognized |
A value this API does not know. It does not confirm that DNSSEC works. |
reasonsandwarningsare machine codes, such asparent_ds_absentoradditional_ds_records. They are not text to show as is.coverageisfullorpartial.activeanddisabledcan come with partial coverage. The problem states need both resolvers.- A resolver that could not be reached answers only
id,availableandreason. checked_atis the time of the observation and may be earlier than your request. Observations can be reused for up to 30 seconds, and public resolvers have their own caches, so a change at the registrar does not show at once.data.local.dscan benull.- The answer has no
ETag. Use the settings read forIf-Match.
Rotate the zone signing key
Section titled “Rotate the zone signing key”This action replaces the zone signing key (ZSK). The key signing key stays, so the DS record at your registrar does not change. The CDN also raises the serial of the zone.
The body is exactly {}. A body with any field, or no body at all, answers 400 INVALID_REQUEST.
curl -X POST "$DNSSEC/actions/dnssec-rotate-zsk/" \ -H "Authorization: Api-Key $DIAMWALL_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: zsk-rotate-2026-11-23-c4" \ -d '{}'The answer holds the settings as the action left them under data, in the same form as the read, and idempotency_replayed. It has no ETag, and nothing of the old or the new key. The new serial is not in it either: read it in data.serial of the SOA settings.
Idempotency-Key
Section titled “Idempotency-Key”The action takes no If-Match. It takes an Idempotency-Key that you make up: 16 to 128 characters, the first a letter or a digit, the others letters, digits, ., _, : or -. Use one key per intent.
| Situation | What happens |
|---|---|
| Same key, same body, within 24 hours of the first sending | The action does not run again. You get the first answer back with idempotency_replayed: true. Its data is the settings as they were then, not as they are now. |
| Same key after those 24 hours | No replay is promised. The key may be rotated a second time. Read the settings instead. |
| Same key, another body | 409 IDEMPOTENCY_CONFLICT. The action does not run. |
| No key, or a key outside the form | 400 IDEMPOTENCY_KEY_REQUIRED or 400 INVALID_IDEMPOTENCY_KEY. |
When an answer is lost or unclear, the code tells you what to do:
| Code | The action | Do this |
|---|---|---|
502 FILE_SERVER_OUTCOME_UNKNOWN |
May have run | Within the 24 hours, send the same request with the same key. After them, read the settings first. |
409 ACTION_OUTCOME_UNKNOWN |
May have run | Stop. Read the settings. Do not repeat the request and do not make a new key to get past it. |
429 ACTION_HISTORY_FULL |
Did not run | Do not send the request again. Waiting does not end it. |
409 DOMAIN_BUSY |
Did not run | Wait a few seconds and send the same request with the same key. |
503 PUBLICATION_FAILED |
Not known | Do not send the request again. Read the settings and compare them with what you meant. |
After a rename
Section titled “After a rename”A domain that is given another name by support keeps its DNSSEC. Its DS record can change with the name. Read the settings again after a rename, and update the DS record at your registrar if it changed.
Limits and permissions
Section titled “Limits and permissions”- Credits. Each domain has a budget of 3000 credits a minute, shared by everyone who calls the API for that domain. Reading or changing the settings and rotating the ZSK cost 8 credits each. The diagnostic costs 25.
- Free refusals. A request refused with
400or428before it reaches the CDN spends no credits. - Out of credits. The call answers
429 TOO_MANY_REQUESTS, with the wait indetails.retry_after_secondsand in theRetry-Afterheader. - Permissions. The settings read and the diagnostic need
dns.viewon the domain. Switching DNSSEC on or off and rotating the ZSK needdns.edit.
Errors you are likely to see
Section titled “Errors you are likely to see”| Status | Code | What happened |
|---|---|---|
400 |
INVALID_REQUEST |
The body is wrong or missing. For the switch, fields names enabled. |
400 |
INVALID_PRECONDITION |
If-Match is not one quoted ETag, sent as it came. |
400 |
IDEMPOTENCY_KEY_REQUIRED, INVALID_IDEMPOTENCY_KEY |
The Idempotency-Key of the action is missing or outside its form. |
404 |
DIAGNOSTIC_NOT_FOUND |
The diagnostic is not available. It is not an empty result. |
409 |
INVALID_STATE |
The keyset of the zone is missing or invalid. Also answered as 503. |
409 |
DOMAIN_BUSY |
Something else is changing the domain. Wait a few seconds and send the same request. |
409 |
DOMAIN_WITHOUT_KEY, DOMAIN_REPLACEMENT_PENDING |
The domain is in a state that does not allow the call. |
409 |
IDEMPOTENCY_CONFLICT |
The same Idempotency-Key was sent with another body. |
409 |
ACTION_OUTCOME_UNKNOWN |
An earlier run with this key has an unknown outcome. Read the settings. |
412 |
REVISION_MISMATCH |
The settings changed since your read. details.current_revision has the new one. Read again and retry. |
415 |
UNSUPPORTED_MEDIA_TYPE |
The body is not JSON. |
428 |
PRECONDITION_REQUIRED |
The If-Match header is missing. |
429 |
TOO_MANY_REQUESTS, RATE_LIMIT_EXCEEDED |
Too many requests. Wait details.retry_after_seconds. |
429 |
ACTION_HISTORY_FULL |
No more runs of the rotation are kept for the domain. |
502 |
FILE_SERVER_OUTCOME_UNKNOWN |
The answer was lost and the write may have been made. |
503 |
PUBLICATION_FAILED |
The change could not be published and verified. Whether anything was written is not known. |
503 |
STATE_CHANGING, RUNTIME_UNAVAILABLE |
The state of the domain is changing or unavailable. Come back later. |
503 |
DNSSEC_UNAVAILABLE, DIAGNOSTIC_UNAVAILABLE, DIAGNOSTIC_FAILED |
The diagnostic could not be read: no resolver was available, or diagnostic capacity was exhausted. |
The errors that come from the key itself, such as API_KEY_IP_NOT_ALLOWED, are on the Errors page.
All DNSSEC endpoints
Section titled “All DNSSEC endpoints”Each row opens the endpoint in the API reference, with every parameter, rule and response.
Loading the endpoints...