# Add a sending domain

> Add your domain to Emailit, publish the DNS records it generates, send them to a developer if needed, and verify the domain so you can send.

This guide walks you through adding a sending domain, publishing its DNS records and verifying it. It takes a few minutes of work, plus however long your DNS provider takes to publish the records.

## Before you begin

- You need access to the DNS settings of the domain, or someone who has it. You can [email the records to them](#send-the-records-to-someone-else).
- Decide which domain you'll send from. Using a subdomain such as `mail.acme.com` keeps your sending reputation separate from your root domain. See [Root domain or subdomain?](/docs/domains/#root-domain-or-subdomain)
- Check that your plan has room for another domain. See [Domain limits](/docs/domains/limits/).
- For the API, use an API key with **Full Access**. Sending-only keys can't manage domains.

## Domain name rules

- Enter the bare domain: `acme.com` or `mail.acme.com`. Don't include `http://`, `https://` or a `www.` prefix.
- Use letters, digits, hyphens and dots, with a top-level domain of at least two letters. Emailit stores the name in lowercase.
- Subdomains at any depth are allowed, for example `eu.mail.acme.com`. Each one is a separate domain with its own records.
- A name can only be added once per workspace. Adding it again returns `409 Domain with this name already exists`.

## Add the domain

**Dashboard**

  1. **Open Domains.** Go to **Email API → Domains** and select **Add domain**.

     If the button is disabled, your workspace has reached its domain limit. The badge next to the page title shows how many you've used.

  2. **Enter the domain.** In **Name**, type the domain you send from, for example `mail.acme.com`, and select **Create**.

  3. **Review the records.** Emailit opens the domain page on the **DNS Setup** tab. It lists each record with its type, name, value, priority and TTL, and a copy button for each value.

**API**

  Call [Create a domain](/docs/api-reference/domains/create/) with the domain name.

```bash
curl https://api.emailit.com/v2/domains \
  -X POST \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "mail.acme.com" }'
```

  The `201` response includes the domain's `id` and a `dns_records` array with every record to publish:

```json
{
  "object": "domain",
  "id": "dom_2kq8Vt4xLm7Rz",
  "name": "mail.acme.com",
  "verification_status": "pending",
  "manual_review_required": false,
  "spf_status": "pending",
  "dkim_status": "pending",
  "return_path_status": "pending",
  "dns_records": [
    {
      "required": true,
      "type": "MX",
      "name": "emailit.mail.acme.com",
      "value": "feedback-smtp.ffdc-1.emailit.com",
      "priority": 10,
      "ttl": "auto",
      "status": "pending",
      "error": null
    },
    {
      "required": true,
      "type": "TXT",
      "name": "emailit.mail.acme.com",
      "value": "v=spf1 include:_spf.emailit.com ~all",
      "priority": null,
      "ttl": "auto",
      "status": "pending",
      "error": null
    }
  ]
}
```

  The full response lists all six records, including DKIM, DMARC, tracking and inbound. You can also set these optional fields when you create the domain:

  | Field | Default | Description |
  | --- | --- | --- |
  | `tracking_key` | `go` | Subdomain prefix for the tracking CNAME. See [Custom tracking domain](/docs/tracking/custom-tracking-domain/). |
  | `inbound_key` | `inbound` | Subdomain prefix for the inbound MX record. |
  | `dmarc_reports` | `false` | Adds Emailit's reporting address to the suggested DMARC record. Pro, Business and Custom only; otherwise `403 plan_required`. |

  `track_loads` and `track_clicks` can't be turned on when you create a domain, because tracking needs a verified tracking CNAME first. Sending `true` returns `422`.

There's no separate switch for outgoing or incoming mail. A verified domain can send, and it receives inbound email as soon as its inbound MX record is published. The API accepts `outgoing` and `incoming` flags for compatibility, but they don't change how the domain behaves.

## Publish the DNS records

Add the records at the company that hosts your domain's DNS. That's often your registrar (GoDaddy, Namecheap) or a DNS service (Cloudflare, Amazon Route 53).

| Record | Type | Host | What to do |
| --- | --- | --- | --- |
| Return path | MX | `emailit.<domain>` | Required. Priority 10. |
| SPF | TXT | `emailit.<domain>` | Required. |
| DKIM | TXT | `emailit._domainkey.<domain>` | Required. Paste the whole value. |
| DMARC | TXT | `_dmarc.<domain>` | Recommended. Skip it if the domain already has a DMARC record. |
| Tracking | CNAME | `go.<domain>` | Only if you want open and click tracking. |
| Inbound | MX | `inbound.<domain>` | Only if you want to receive email. Priority 10. |

Most DNS providers want only the part before your domain in the host field (`emailit`, not `emailit.acme.com`). [DNS records](/docs/domains/dns-records/) has the exact values, provider-specific tips and common mistakes.

If your domain uses Cloudflare DNS, the domain page offers **Set up with Cloudflare**, which creates the records for you. See [Set up DNS with Cloudflare](/docs/domains/cloudflare/).

## Send the records to someone else

If someone else manages your DNS, email them the records from the dashboard.

1. **Open the domain.** In **Email API → Domains**, select the domain.

2. **Select Send to email.** It's in the top-right corner of the **DNS Setup** card.

3. **Enter their address.** In **Recipient Email**, type the address of your developer or IT administrator and select **Send Instructions**.

They receive an email from Emailit with every record and its value. Ask them to tell you when the records are published so you can run the check.

## Check DNS and verify

**Dashboard**

  On the domain page, select **Check DNS**. Emailit looks up every record and updates the status next to each one: **OK**, **Missing**, **Invalid** or **Not checked**. Hover over **Missing** or **Invalid** to see what Emailit found.

**API**

  Call [Verify a domain](/docs/api-reference/domains/verify/). You can use the domain ID or its name.

```bash
curl https://api.emailit.com/v2/domains/mail.acme.com/verify \
  -X POST \
  -H "Authorization: Bearer $EMAILIT_API_KEY"
```

  The response contains the updated domain. Check `verification_status` and the `status` and `error` of each item in `dns_records`.

> **Verification only runs when you ask for it:** Emailit doesn't verify a new domain on its own. After you publish or fix records, run **Check DNS** again. DNS changes usually appear within minutes, but some providers take up to 48 hours.

The domain is verified when SPF, DKIM and the return path all show **OK**. DMARC, tracking and inbound are optional and don't affect verification.

## Verify it worked

- The domain shows **Verified** in **Email API → Domains**, and the **SPF**, **DKIM** and **Return Path** columns show **OK**.
- Send a test message from an address on the domain. On the **Emails** page, select **Compose**, or call [Send an email](/docs/api-reference/emails/send/).

If the domain shows **Pending verification**, it's waiting for a manual review. This applies to Pay as you go domains registered less than 30 days ago. See [Domain verification](/docs/domains/verification/#pending-verification).

> **Note:** A verified domain doesn't lift sandbox mode. Until your workspace has production access, you can only send to the account emails of workspace members. See [Production access](/docs/workspaces/production-access/).

## Troubleshooting

| Problem | Fix |
| --- | --- |
| **Add domain** is disabled | You've reached your plan's domain limit. Delete an unused domain or raise the limit. See [Domain limits](/docs/domains/limits/). |
| `The domain must be in apex format` | Remove `http://`, `https://` or `www.` and make sure the name ends in a real top-level domain. |
| Records show **Missing** after an hour | The host is probably doubled, for example `emailit.acme.com.acme.com`. Enter only `emailit` in the host field. |
| DKIM shows **Invalid** | Part of the value was cut off. Copy it again with the copy button. |

[Domain verification](/docs/domains/verification/#troubleshooting) covers more cases.

## Related

  - [DNS records](/docs/domains/dns-records/): Reference for every record Emailit generates.
  - [Domain verification](/docs/domains/verification/): Statuses, manual review and daily re-checks.
  - [Custom tracking domain](/docs/tracking/custom-tracking-domain/): Set up open and click tracking.
  - [Set up inbound email](/docs/inbound/set-up/): Receive email on your domain.

---
Source: https://emailit.com/docs/domains/add-a-domain/
