Skip to content

Look up current nameservers

POST /api/v2/domains/nameservers/lookup

Look up the nameservers a domain uses right now, through public DNS. Use it before a transfer to keep the current nameservers. No API key is needed. The domain does not have to be in your account.

The response lists at most ten nameservers. The list is empty when the domain has no NS records or DNS gives no answer within five seconds.

Authentication: None. Anyone can call it.

Request

Body

domainstringrequired
The registered domain to look up, for example example.com. A URL also works: the scheme, path and port are dropped. A subdomain such as www.example.com usually has no NS records of its own and returns an empty list.

Example

POST /api/v2/domains/nameservers/lookup
curl -X POST "https://cloud.hostup.se/api/v2/domains/nameservers/lookup" \
-H "Content-Type: application/json" \
-d '{
"domain": "example.com"
}'

Responses

200 The nameservers found. An empty list means none were found.

Response 200
{
"domain": "example.com",
"nameservers": [
"a.iana-servers.net",
"b.iana-servers.net"
]
}
Response fields
domainstring
The name that was looked up, without any scheme, path or port you sent.
nameserversarray of string
Up to ten nameservers from public DNS. Empty when none were found.

Errors

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

400domain is missing, not a string, longer than 253 characters, or not a valid domain name.
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.