Skip to content

Create or update a glue record

POST /api/v2/domains/{id}/glue-records

Registers a glue record for one of the domain’s own nameservers at the registry. If the hostname already has a glue record, its IP addresses are replaced. Check actions.canCreateGlueRecord.allowed on GET /api/v2/domains/{id}/glue-records first. Only .se and .nu domains are supported. This does not change the domain nameserver set. To use the nameserver, add it with POST /api/v2/domains/{id}/nameservers. It does not create A or AAAA records in the DNS zone either.

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

Request

Path parameters

idstringrequired
The domain ID. From GET /api/v2/domains.

Body

hostnamestringrequired
The nameserver’s fully qualified hostname under the domain, for example ns1.example.se for example.se.
ipsarray of stringrequired
1-10 valid public IPv4 or IPv6 addresses for the nameserver. Replaces any addresses already registered.

Example

POST /api/v2/domains/{id}/glue-records
curl -X POST "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/glue-records" \
-H "Authorization: Bearer $HOSTUP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"hostname": "ns1.example.se",
"ips": [
"192.0.2.10",
"2001:db8::10"
]
}'

Responses

201 The glue record was registered or updated.

Response 201
{
"hostname": "ns1.example.se",
"ips": [
"192.0.2.10",
"2001:db8::10"
]
}
Response fields
hostnamestring
The nameserver hostname.
ipsarray of string
The IP addresses now registered.

Errors

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

400The request was refused. A malformed hostname or IP address is named in errors[].pointer. A private IP address, a hostname that is not under the domain, a domain that is not .se or .nu, and a refusal by the registry all answer detail “The request is invalid.” without saying which. Check those before you call.
401Unauthorized. Authentication is required.
403The API key lacks write:domains (the body lists requiredScopes), or the registry refused the change for this domain. A domain that is not on your account answers 404.
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.