Skip to content
Dashboard

Domains and DNS

View as Markdown

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.

@RRSIGDS

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"

Switching DNSSEC on takes four steps, and the last one is not done through this API:

  1. Read the settings and keep the ETag header of the answer.
  2. Send PATCH with { "enabled": true } and that ETag in If-Match.
  3. Take the DS record from data.ds of the answer and publish it at your registrar. Neither the API nor the CDN publishes it for you.
  4. Run the diagnostic until data.status is active.
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 ETag header 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", a revision of null, no data and no ETag. There is nothing to send in If-Match, so do not write.
  • publication.rollout is always unknown. The answer does not prove anything about every point of presence.

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 CD491DBDCC608D79ACD01FC094D0AFC219DEB760CB36736C8715759E0A4F7DAB

The 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.

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. true switches DNSSEC on, false switches it off.
  • A string, a number or null in enabled answers 400 INVALID_REQUEST with enabled in fields. 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 ETag header for the next change.
  • After switching on, the DS record to publish is data.ds of this answer, when it is resolved and has its value. If it is not, read the settings again.

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.
  • reasons and warnings are machine codes, such as parent_ds_absent or additional_ds_records. They are not text to show as is.
  • coverage is full or partial. active and disabled can come with partial coverage. The problem states need both resolvers.
  • A resolver that could not be reached answers only id, available and reason.
  • checked_at is 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.ds can be null.
  • The answer has no ETag. Use the settings read for If-Match.

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.

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.

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.

  • 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 400 or 428 before it reaches the CDN spends no credits.
  • Out of credits. The call answers 429 TOO_MANY_REQUESTS, with the wait in details.retry_after_seconds and in the Retry-After header.
  • Permissions. The settings read and the diagnostic need dns.view on the domain. Switching DNSSEC on or off and rotating the ZSK need dns.edit.
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.

Each row opens the endpoint in the API reference, with every parameter, rule and response.

Loading the endpoints...