Skip to content

Connect a domain's email to Hostup web hosting

3 steps · Checked against the API code 3 November 2026

A guide does one task from start to finish. Every endpoint, with all its fields and cases, is in the API reference.

When the mailboxes are on a Hostup web hosting account, the hosting can write the domain’s email records itself. One call adds the MX, SPF and DKIM records and makes the hosting accept the domain’s mail. For any other mail provider, follow Set up MX, SPF, DKIM and DMARC for a domain.

export ACCOUNT_ID="acct_…" # your hosting account: List web hosting accounts

Get the DNS setup of a hosting domain shows what the domain’s website and mail point at now.

GET /api/v2/shared-hosting/{accountId}/domains/dns-setup
curl "https://cloud.hostup.se/api/v2/shared-hosting/$ACCOUNT_ID/domains/dns-setup?domain=example.com" \
-H "Authorization: Bearer $HOSTUP_API_KEY"
Response 200
{
"domain": "example.com",
"enabled": true,
"delegation": "hostup",
"hostingIp": "192.0.2.10",
"classification": {
"website": "elsewhere",
"mail": "missing",
"mx": [],
"requiresChoice": true,
"recommendedPreference": "email-only",
"…": "…"
},
"revision": "5f8c1d2e9a7b4c3d6e1f0a9b8c7d6e5f4a3b2c1d0e9f8a7b6c5d4e3f2a1b0c9d",
"publication": null,
"canApply": true,
"…": "…"
}

Go on only when enabled and canApply are true. Keep revision. Step 2 sends it back.

export REVISION="…" # revision above
  • classification.mail says where mail goes now: hosting, elsewhere, missing or disabled.
  • delegation is hostup when the domain uses Hostup’s nameservers.

Choose email-only to move email to the hosting and leave the website records alone. Choose full to move both the website and email.

POST /api/v2/shared-hosting/{accountId}/domains/dns-setup
curl -X POST "https://cloud.hostup.se/api/v2/shared-hosting/$ACCOUNT_ID/domains/dns-setup" \
-H "Authorization: Bearer $HOSTUP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "example.com",
"preference": "email-only",
"revision": "'$REVISION'"
}'
Response 200
{
"success": true,
"domain": "example.com",
"preference": "email-only",
"status": "done"
}

For email, the setup writes these records in the domain’s zone:

  • An MX record on the domain pointing at mail.example.com with priority 10.
  • An A record for mail with the hosting’s address.
  • The SPF record with the hosting’s servers added. Senders already in it stay.
  • A DKIM TXT record at default._domainkey with the hosting’s key.

The setup also switches the hosting’s email routing for the domain to local. The hosting account then accepts mail for the domain. An existing DMARC record stays as it is. The setup does not add one. Add it as in Set the DMARC record.

If the setup answers 409 dns_plan_conflict

Section titled “If the setup answers 409 dns_plan_conflict”

The records cannot be changed automatically. Add them yourself with Create a DNS record, in this order:

  1. An A record for mail with hostingIp from step 1.
  2. An MX record at @ for mail.example.com with priority 10.
  3. include:spf.hostup.se in the domain’s SPF record.
  4. The DKIM record. Check DKIM, SPF and DMARC for a domain gives its name in dkim.name and its value in dkim.requiredValue.
  5. Email routing local with Set email routing for a domain.

Set up MX, SPF, DKIM and DMARC for a domain shows each of these requests.

"status": "done" in step 2 means the zone matches the setup. "pending" means it does not yet. Read the setup state again until publication is no longer pending and classification.mail is hosting.

GET /api/v2/shared-hosting/{accountId}/domains/dns-setup
curl "https://cloud.hostup.se/api/v2/shared-hosting/$ACCOUNT_ID/domains/dns-setup?domain=example.com" \
-H "Authorization: Bearer $HOSTUP_API_KEY"
Response 200
{
"domain": "example.com",
"classification": {
"mail": "hosting",
"…": "…"
},
"publication": "done",
"…": "…"
}

publication is pending while the setup is not in the zone yet. The first read that finds it in place says done. Later reads say null.

The setup can be applied while the domain uses other nameservers. Nothing is live until the nameservers point at Hostup. Change a domain’s nameservers shows how.

The records are in the domain’s zone when step 3 shows hosting. Mail servers that looked up the old MX records can keep using them until the old TTL has passed. Keep the old mailboxes until then.

Next: Set the DMARC record, which the setup leaves to you.

The setup answers 409 with one of these codes when it refuses:

Other answers:

  • 503 dns_read_unavailable: the setup state could not be read. The apply answers the same when step 1 showed canApply as false or no revision. Read the state again a little later.
  • 503 or 502 domain_not_attached: the domain is not on this hosting account. The read answers 503 and the apply answers 502. Retrying does not change that answer. Add the domain to the account first with Add a domain to web hosting.
  • 403 forbidden: the key lacks a scope the call needs. When a key is refused