Skip to content

Add a DNSSEC record

POST /api/v2/domains/{id}/dnssec

Adds one DS or KEY record for the domain at the registry. Use it when another DNS provider signs the domain’s zone and gives you the record. Domains on Hostup nameservers normally get their DS record from automatic DNSSEC (GET /api/v2/domains/{id}/dnssec-auto). Before you call it, check that actions.canAdd.allowed is true on GET /api/v2/domains/{id}/dnssec. That response also says whether the registry takes DS or KEY records. If it lists detectedRecords, send the values of one of them to turn DNSSEC on for a zone that is already signed. The change goes to the registry right away. A wrong record can make the domain stop resolving for resolvers that check DNSSEC. While a .se or .nu registry lock is on, the call returns 409 registry_lock_unlock_required.

Authentication: An API key with the scope write:domains. About keys and scopes

Request

Path parameters

idstringrequired
The domain ID (dom_…).

Body

typestringrequired
DS needs keyTag, algorithm, digestType and digest. KEY needs flag, protocol, algorithm and publicKey. One of DS, KEY.
keyTagstring
Key tag from the DS record. Required when type is DS.
algorithmstringrequired
DNSSEC algorithm number, such as 13. Must be one of allowedAlgorithms.
digestTypestring
Digest type number, such as 2 for SHA-256. Required when type is DS.
digeststring
The digest in hexadecimal, without spaces. Required when type is DS.
flagstring
Key flags, normally 257 for a key-signing key. Required when type is KEY.
protocolstring
Protocol number, 3 for DNSSEC. Required when type is KEY.
publicKeystring
The base64 public key from the DNSKEY record, without the flag, protocol and algorithm fields. Required when type is KEY.
recoveryValuesobject
Values asked for by a previous dnssec_recovery_required response. Send only the keys listed in recovery.fields.

Example

POST /api/v2/domains/{id}/dnssec
curl -X POST "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/dnssec" \
-H "Authorization: Bearer $HOSTUP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "DS",
"keyTag": "2371",
"algorithm": "13",
"digestType": "2",
"digest": "5A1D7C1B9E7F4E6A8C2B0D5F9A3E6C7D8B1A2C3D4E5F60718293A4B5C6D7E8F9"
}'

Responses

201 The record was sent to the registry. The response echoes it. id can be null.

Response 201
{
"recordType": "DS",
"ds": {
"id": null,
"keyTag": "2371",
"algorithm": "13",
"digestType": "2",
"digest": "5A1D7C1B9E7F4E6A8C2B0D5F9A3E6C7D8B1A2C3D4E5F60718293A4B5C6D7E8F9"
},
"key": null
}
Response fields
recordTypestring
DS or KEY. One of DS, KEY.
dsobject | null
The DS record. Null for a KEY record.
idstring | null
The record ID (dsr_…). Can be null here. Read GET /api/v2/domains/{id}/dnssec for it.
keyTagstring | null
Key tag of the key the record points to.
algorithmstring | null
DNSSEC algorithm number.
digestTypestring | null
Digest type number.
digeststring | null
The digest in hexadecimal.
keyobject | null
The KEY record. Null for a DS record.
idstring | null
The record ID (dsr_…). Can be null here. Read GET /api/v2/domains/{id}/dnssec for it.
flagstring | null
Key flags. 257 is a key-signing key.
protocolstring | null
Protocol number. Always 3 for DNSSEC.
algorithmstring | null
DNSSEC algorithm number.
publicKeystring | null
The public key in base64.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400The body is not valid or the registry rejected the record. errors[] points at the field. invalid_record_type means the domain takes the other record type. A domain can hold at most six DS records.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404Not found. The resource does not exist or is not owned by the caller; code is domain_not_found.
409The .se or .nu registry lock is on. The registry refuses DNSSEC changes until the lock is removed with POST /api/v2/domains/{id}/actions/request-unlock.
422The registry needs more details first. recovery.fields lists them. Send them as recoveryValues in the same body and try again. A field with target account is changed in the account details instead.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.
502The change was sent but could not be confirmed afterwards (upstream_failed). Read GET /api/v2/domains/{id}/dnssec before you try again.