Skip to content

Validate nameservers

POST /api/v2/domains/nameservers/validate

Check nameserver hostnames before you order a domain, transfer one or change its nameservers. Each hostname must be well formed and resolve to an IPv4 or IPv6 address. No API key is needed. Each IP address can call it 30 times a minute.

Send domain to run the registry check as well. For a .se or .nu domain, every nameserver whose hostname ends in .se or .nu must exist at the registry. A missing one fails with GLUE_HOST_NOT_REGISTERED. If the registry can’t be reached, that check is skipped and the nameserver can still pass. Register a nameserver under your own domain with POST /api/v2/domains/{id}/glue-records.

The response has one result per nameserver, in the order you sent them. The status is 200 even when a nameserver fails. Read isValid on each result. The codes here are upper case. POST /api/v2/domains/{id}/nameservers reports the same glue failure as glue_host_not_registered.

Authentication: None. Anyone can call it.

Request

Body

nameserversarray of stringrequired
Nameserver hostnames to check, one to ten. An empty list is not rejected. It returns 200 with an empty results. Send at least one.
domainstring
The domain the nameservers are for. Turns on the registry check for .se and .nu domains.

Example

POST /api/v2/domains/nameservers/validate
curl -X POST "https://cloud.hostup.se/api/v2/domains/nameservers/validate" \
-H "Content-Type: application/json" \
-d '{
"nameservers": [
"primary.ns.hostup.se",
"secondary.ns.hostup.se"
],
"domain": "example.com"
}'

Responses

200 One result per nameserver. errorCode says why one failed: EMPTY_VALUE (blank entry), INVALID_FORMAT (not a valid hostname), NOT_FOUND (the hostname has no IPv4 or IPv6 address), DNS_RESOLUTION_FAILED (the lookup failed this time; try again) or GLUE_HOST_NOT_REGISTERED (the .se or .nu nameserver does not exist at the registry).

{
"results": [
{
"ns": "primary.ns.hostup.se",
"isValid": true,
"errorCode": null,
"errorMessage": null
},
{
"ns": "secondary.ns.hostup.se",
"isValid": true,
"errorCode": null,
"errorMessage": null
}
]
}
Response fields
resultsarray of object
nsstring
The nameserver as you sent it, trimmed.
isValidboolean
True when the nameserver passed every check.
errorCodestring or null
Why it failed. EMPTY_VALUE: blank entry. INVALID_FORMAT: not a valid hostname. NOT_FOUND: the hostname has no IPv4 or IPv6 address. DNS_RESOLUTION_FAILED: the lookup failed this time. Try again. GLUE_HOST_NOT_REGISTERED: the .se or .nu nameserver does not exist at the registry. This is checked only when you send a .se or .nu domain. Null when valid. One of EMPTY_VALUE, INVALID_FORMAT, NOT_FOUND, DNS_RESOLUTION_FAILED, GLUE_HOST_NOT_REGISTERED.
errorMessagestring or null

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