Skip to content

Change nameservers on several domains

POST /api/v2/domains/bulk/nameservers

Point several domains at the same nameservers. This changes the nameservers registered for each domain at the registry. It does not change NS records inside a DNS zone. Use primary.ns.hostup.se and secondary.ns.hostup.se for DNS hosted by Hostup.

Send between one and ten nameservers. Most domains need at least two. A .se or .nu domain accepts a single nameserver when it is not a Hostup nameserver. The Hostup nameservers always go together as a pair.

Every nameserver is checked before the job is queued. Each must resolve to an IPv4 or IPv6 address. For a .se or .nu domain, a nameserver whose hostname ends in .se or .nu must also exist at the registry. Register a nameserver under your own domain (such as ns1.example.com) first with POST /api/v2/domains/{id}/glue-records. A nameserver that fails a check rejects the whole call with 422. The response does not say which one failed. POST /api/v2/domains/nameservers/validate with domain set shows it. The whole batch is also rejected when any domain ID is invalid or not in your account.

Before the job is queued, the current DNS records of each domain are saved as a snapshot (GET /api/v2/domains/{id}/dns/snapshots). The call returns 202 with a job. Follow it at operation.pollUrl (Jobs).

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

Request

Body

domainIdsarray of stringrequired
Domain IDs (dom_…) to change. At least one.
nameserversarray of stringrequired
Nameserver hostnames, one to ten. At least two unless every domain is .se or .nu and the nameserver is not Hostup’s.

Example

POST /api/v2/domains/bulk/nameservers
curl -X POST "https://cloud.hostup.se/api/v2/domains/bulk/nameservers" \
-H "Authorization: Bearer $HOSTUP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domainIds": [
"dom_01hxa3b4c5d6e7f8g9h0j1k2m3",
"dom_01hxa3b4c5d6e7f8g9h0j1k2m4"
],
"nameservers": [
"primary.ns.hostup.se",
"secondary.ns.hostup.se"
]
}'

Responses

202 Job queued. Follow it at operation.pollUrl.

Response 202
{
"operation": {
"status": "pending",
"jobId": "dbj_01hxa3b4c5d6e7f8g9h0j1k2m3",
"pollUrl": "/api/jobs/dbj_01hxa3b4c5d6e7f8g9h0j1k2m3"
},
"domainsQueued": 2
}
Response fields
operationobject
statusstring
Where the job is. A 202 Accepted response only has pending, queued or in_progress. completed and failed appear when you poll pollUrl. They also appear in a 200 OK response when the action finished during the request. One of pending, queued, in_progress, completed, failed.
jobIdstring
pollUrlstring or null
Where to poll the job while it runs. null when status is already completed or failed.
domainsQueuedinteger or null
Number of domains in the job.

Errors

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

400Validation failed. Check the body, the number of nameservers and the hostname format. When a domain needs more nameservers, errors[] points to it in /domainIds/{index}.
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.
422A nameserver failed the check. Either it does not resolve or a .se or .nu host is not registered at the registry. Nothing was queued. The response does not name the domain or the nameserver.
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.