
# Set up a domain

Mail can only reach your address, and other servers can only trust your mail,
once your domain's DNS says so. Setting up a domain has three parts: add it,
publish the DNS records Cruma shows you, and check them.

## 1. Add the domain

Open **Email → Settings → Domains**, type the name under **Domain name**
(for example `example.com`) and select **Add domain**. A name can belong to
only one organization, so a name another organization already uses is refused.

The domain starts as **Waiting for DNS**. It becomes **Verified** once Cruma
finds the records marked *Required* in the next step.

## 2. Publish the DNS records

Select **DNS records** on the domain. Cruma lists five records, each with its
**Type**, **Name** and **Value**, and a **Copy** button next to each. Add them
where your domain's DNS is managed.

| Record | What it does | Needed to verify |
| --- | --- | --- |
| **Ownership check** (TXT) | Proves the domain is yours. It has no effect on your email. | Yes |
| **MX** | Tells the Internet to deliver mail for your domain to Cruma. | Yes |
| **SPF** (TXT) | Lists the servers allowed to send as your domain. | Recommended |
| **DKIM** (TXT) | Publishes the public half of the key that signs your outgoing mail. | Recommended |
| **DMARC** (TXT) | Tells receivers what to do with mail that fails the SPF and DKIM checks. | Recommended |

The recommended records aren't needed to verify the domain, but without them
your mail is much more likely to be treated as spam. Add all five.
[Sending well](https://cruma.io/book/mail/sending-well.md) explains what SPF, DKIM and DMARC do.

An example for `example.com`. Always copy the exact values from the dashboard,
because the key and the token are yours alone:

| Type | Name | Value |
| --- | --- | --- |
| TXT | `_cruma-mail.example.com` | `cruma-mail-verification=…` |
| MX | `example.com` | priority `10`, server `mail.cruma.io` |
| TXT | `example.com` | `v=spf1 a:mail.cruma.io ~all` |
| TXT | `mail._domainkey.example.com` | `v=DKIM1; k=rsa; p=…` (a long public key) |
| TXT | `_dmarc.example.com` | `v=DMARC1; p=none` |

Notes that save time:

- **Names.** Some DNS hosts want the name relative to the domain (`_dmarc`
  rather than `_dmarc.example.com`), and `@` for the domain itself. Use the form
  your host asks for.
- **One SPF record.** A domain may have only one SPF record. If you already
  have one, add Cruma's part to it instead of creating a second.
- **Existing MX records.** The domain's mail goes where its MX records point.
  Remove the old MX records when you move your mail to Cruma, or mail keeps
  arriving at the old provider.
- **The DKIM key.** The value is long. If your DNS host splits it into several
  quoted pieces, that is fine: Cruma compares it with the spaces ignored.
- **DMARC starts gentle.** `p=none` only asks receivers to report, not to
  reject. You can tighten it once your mail is passing. Don't change it without
  keeping SPF and DKIM in place.

### Domains hosted at Cruma DNS

If your organization hosts the domain at [Cruma DNS](https://cruma.io/book/cruma-dns/introduction.md),
the **DNS records** panel offers **Set up automatically**. Select it and Cruma
publishes the five records for you, then checks the domain straight away. The
panel shows, for each record, what happened:

| Shown | Meaning |
| --- | --- |
| Added | The record was not there and Cruma created it. |
| Updated | The ownership check existed with another value and Cruma changed it. |
| Already in place | The record was already published as shown. Nothing was written. |
| Different record already there, left as it is | See below. |
| Could not be added | Cruma could not write the record, for example because the DNS service does not accept it. The reason is shown next to it; add that record by hand as described below. |

You can select it again at any time. Records that are already in place are left
alone, so it never creates duplicates.

Cruma writes only these five mail records: the MX record, the SPF part of the
domain's text records, and the text records at `_cruma-mail`, `_dmarc` and the
DKIM name. Every other record in the zone is left as it is, including other
text records at the domain name.

- **An MX, SPF, DKIM or DMARC record already says something else.** That is
  often another mail provider's working setup, so Cruma leaves it as it is and
  tells you. Select **Replace them** only if you want mail to go through Cruma
  from now on. Replacing the MX record replaces the domain's whole set of MX
  records, so mail for the domain stops going to any other provider.
- **You need DNS access.** Setting up automatically changes your DNS, so you
  need permission to edit DNS in the organization, besides managing email. If
  you don't have it, Cruma says so and nothing is written; ask an owner or admin.
- **It needs you signed in.** Setting up automatically is not available to API
  keys. Use the dashboard.
- **The domain isn't in your organization's Cruma DNS.** The button isn't shown.
  Add the records as described below, or add the domain to Cruma DNS first.

You can still add the records yourself, by hand: open **Geo-DNS → Domains →
Manage records** and create them as described in
[managing records](https://cruma.io/book/cruma-dns/records.md). For the MX record, type the value as
`10 mail.cruma.io.` on one line.

### Domains hosted somewhere else

Add the same records at your registrar or DNS host. Cruma can read them from
anywhere on the Internet, so the domain doesn't have to move to Cruma DNS.

## 3. Check the status

After you publish the records, select **Check DNS** under the domain's records.
Each record shows one of:

| Shown | Meaning |
| --- | --- |
| Found | The record is published as expected. |
| Not found yet | Cruma can't see it. Check the name and type, and wait a few minutes. |
| Found, but the value is different | A record exists on that name but its value isn't the one shown. |
| Could not check right now, try again | The lookup failed; try again shortly. |

When both required records are found, the domain turns **Verified** and the
message says so. DNS changes can take from minutes to a few hours to spread. If
you just added them, wait and check again. You can check as often as you like.

A verified domain stays verified. If a recommended record is still missing,
Cruma says so and keeps showing it, so you can finish the job.

You can create mailboxes on a domain as soon as it is added, but a mailbox can
only **send** mail once its domain is verified.

## Turning a domain off or deleting it

- **Turn off** stops the domain receiving mail until you turn it back on. Its
  mailboxes and aliases are kept. Turning it back on returns it to *Waiting for
  DNS* until the records are checked again.
- **Delete** removes the domain together with its mailboxes, their messages and
  its aliases. This can't be undone.

Both ask you to confirm. Delete the MX records at your DNS host too if you
stop using the domain with Cruma, so nobody keeps mailing an address that
no longer exists.

---

- Book: [Cruma Email (Private preview)](https://cruma.io/book/mail.md)
- Previous: [Introduction](https://cruma.io/book/mail/introduction.md)
- Next: [Mailboxes and aliases](https://cruma.io/book/mail/mailboxes-and-aliases.md)
- Pages: [Home](https://cruma.io/home.md) · [Docs](https://cruma.io/docs.md) · [Pricing](https://cruma.io/pricing.md) · [Share localhost](https://cruma.io/share-localhost.md) · [Webhook testing](https://cruma.io/webhook-testing.md) · [Homelab](https://cruma.io/homelab.md) · [AI coding agents](https://cruma.io/ai-coding-agents.md) · [Cruma vs ngrok](https://cruma.io/ngrok-alternative.md) · [Cruma vs Cloudflare Tunnel](https://cruma.io/cloudflare-tunnel-alternative.md) · [Blog](https://cruma.io/blog.md)
