Get the DNS setup of a hosting domain
GET /api/v2/shared-hosting/{accountId}/domains/dns-setup
Shows where the website and email of a domain on the web hosting account point today. It also shows whether its DNS can be pointed at the account. Read it before POST /api/v2/shared-hosting/{accountId}/domains/dns-setup and send its revision back with the choice. classification.recommendedPreference is the choice that keeps the current services working. The domain must be the main domain, an addon domain or a parked domain of the account. The account must be active. A domain that is not on the account returns 503 domain_not_attached. Retrying does not help then.
Authentication: An API key with the scopes read:hosting and read:dns and console:services. About keys and scopes
Request
Path parameters
accountIdstringrequiredacct_…).Query parameters
domainstringrequiredExample
curl "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/domains/dns-setup?domain=example.com" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
200 Where the domain’s website and email point and what the setup can do.
{ "domain": "example.com", "hostingName": "example.se", "currentMailAddresses": [], "enabled": true, "delegation": "hostup", "hostingIp": "192.0.2.10", "classification": { "website": "parking", "mail": "missing", "apex": [ "192.0.2.80" ], "www": [ "192.0.2.80" ], "mx": [], "requiresChoice": false, "recommendedPreference": "full" }, "revision": "5f8c1d2e9a7b4c3d6e1f0a9b8c7d6e5f4a3b2c1d0e9f8a7b6c5d4e3f2a1b0c9d", "pendingChoice": true, "publication": null, "canApply": true}Response fields
domainstringhostingNamestringcurrentMailAddressesarray of stringenabled is false.enabledbooleandelegationstringhostup: the domain uses Hostup’s nameservers. external: other nameservers. unknown: the lookup failed. A choice can be saved while the delegation is external. It takes effect when the nameservers move to Hostup. One of hostup, external, unknown.hostingIpstring or nullnull when it is not known.classificationobject | nullnull when the setup is not offered (enabled: false), when the domain has no DNS zone at Hostup, or when the zone could not be read.websitestringhosting: this account. parking: Hostup’s parking page. stale: a Hostup server that no longer hosts the domain. missing: no website record. elsewhere: another provider. redirect: a domain redirect is active. One of hosting, parking, stale, missing, elsewhere, redirect.mailstringhosting: this account. missing: no MX record. elsewhere: another provider. disabled: a null MX record says the domain takes no mail. One of hosting, missing, elsewhere, disabled.apexarray of stringwwwarray of stringwww.mxarray of string. stands for a null MX record.requiresChoicebooleantrue when the website or email point elsewhere. Pointing them at the hosting account would replace them.recommendedPreferencestringfull, email-only, website-only, none.revisionstring or nullPOST. null when classification is null or the nameservers could not be looked up.pendingChoicebooleantrue while the domain waits for a setup choice.publicationstring or nullpending while an applied setup is not in the zone yet. done on the first read after it is, null after that. null also when no setup was applied in the last hour. One of pending, done.canApplybooleantrue when the setup is offered, the domain’s DNS zone at Hostup was read and the hosting address is known. POST with a choice other than none also needs a revision. While revision is null the POST returns 503.Errors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | domain is missing or not a valid domain name. |
| 401 | Unauthorized. Authentication is required. |
| 403 | The API key lacks a required scope or the hosting account is not active. |
| 404 | Not found. The resource does not exist or is not owned by the caller. |
| 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. |
| 503 | The read failed. code is domain_not_attached when the domain is not the main, an addon or a parked domain of the account; retrying does not help then. It is dns_read_unavailable when the DNS could not be checked; try again later. |