Skip to content

Get domain nameservers

GET /api/v2/domains/{id}/nameservers

Shows the domain’s nameservers and whether they can be changed now. Check actions.canChangeNameservers.allowed before you call POST /api/v2/domains/{id}/nameservers. A change is blocked during a transfer and while the domain is pending, suspended, expired or no longer managed here. On a .se or .nu domain, registrarLock.requiresRegistryUnlockFlow is always true and registrarLock.unlockAction is always set. The lock only blocks a change when registrarLock.enabled is also true. Then request an unlock with unlockAction first. dnssecAutoWillBeBlocked is true when a nameserver change now would pause automatic DNSSEC for a cooldown period. Hostup’s own nameservers are primary.ns.hostup.se and secondary.ns.hostup.se.

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

Request

Path parameters

idstringrequired
The domain ID (dom_…).

Example

GET /api/v2/domains/{id}/nameservers
curl "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/nameservers" \
-H "Authorization: Bearer $HOSTUP_API_KEY"

Responses

200 The nameservers, the domain lock and whether the nameservers can be changed.

Response 200
{
"nameservers": [
"primary.ns.hostup.se",
"secondary.ns.hostup.se"
],
"registrarLock": {
"enabled": false,
"requiresRegistryUnlockFlow": true,
"unlockAction": {
"method": "POST",
"href": "/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/request-unlock"
}
},
"actions": {
"canChangeNameservers": {
"allowed": true,
"reason": null
}
},
"dnssecAutoWillBeBlocked": true
}
Response fields
nameserversarray of string
The nameservers the domain uses now.
registrarLockobject
enabledboolean or null
requiresRegistryUnlockFlowboolean
True for .se and .nu domains. Their domain lock is removed with POST /api/v2/domains/{id}/actions/request-unlock. The lock only blocks a nameserver change when enabled is also true.
unlockActionobject | null
The unlock request for a .se or .nu domain. Null for other domains. Call it only when enabled is true.
methodstring
One of POST.
hrefstring
actionsobject
canChangeNameserversobject
allowedboolean
reasonstring or null
codestring or null
A machine-readable code for why the action is blocked.
dnssecAutoWillBeBlockedboolean
True when changing the nameservers now pauses automatic DNSSEC for a cooldown period.

Errors

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

400Invalid request. The response body is an RFC 7807 Problem Details document.
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.
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.
502Upstream failure. A dependent provider request failed; the Problem Details code is upstream_failed. Retry later or contact support if the issue persists.