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 stringrequired200 with an empty results. Send at least one.domainstringExample
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" }'curl -X POST "https://cloud.hostup.se/api/v2/domains/nameservers/validate" \ -H "Content-Type: application/json" \ -d '{ "nameservers": [ "ns1.example.se", "ns2.example.se" ], "domain": "example.se" }'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 } ]}{ "results": [ { "ns": "ns1.example.se", "isValid": true, "errorCode": null, "errorMessage": null }, { "ns": "ns2.example.se", "isValid": false, "errorCode": "GLUE_HOST_NOT_REGISTERED", "errorMessage": "Glue nameserver host is not registered at the registry." } ]}Response fields
resultsarray of objectnsstringisValidbooleanerrorCodestring or nullEMPTY_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 nullErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | Invalid request. The response body is an RFC 7807 Problem Details document. |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |