---
title: "Custom domains"
description: "Addresses on a domain you own: adding the domain, publishing its DNS records automatically or by hand, verification, the days an unverified domain is kept, inboxes on the domain, and removal."
url: https://doorman.fyi/docs/custom-domains
markdown: https://doorman.fyi/docs/custom-domains.md
area: "Guides"
section: "Mail"
---

# Custom domains

Addresses on a domain you own: adding the domain, publishing its DNS records automatically or by hand, verification, the days an unverified domain is kept, inboxes on the domain, and removal.

Source: https://doorman.fyi/docs/custom-domains

## A domain of your own

Every account can issue addresses on the shared domain, `doorman.example`. A custom domain puts addresses on a name you own instead, such as `concierge@agents.example.com`: you add the domain, publish a few DNS records for it, and once they are verified you create inboxes on it exactly as on the shared domain. The shared domain keeps working beside it.

- The plan: The Unlimited plan includes 10 custom domains and the Free plan none; past the plan's allowance the API answers `402 plan_limit_reached` with `scope: "domains"`. Every plan has a ceiling of 50 domains per account (`409 limit_reached`). See [Plans, limits and errors](https://doorman.fyi/docs/limits.md#plans).
- The deployment: Custom domains need a mail transport on the deployment. [`GET /v1/me`](https://doorman.fyi/docs/reference/account.md#me) says whether it has one in `features.customDomains`. Where it is false, adding a domain answers `503 custom_domains_unavailable` and the console says so instead of showing the form.
- The DNS: Somebody has to publish records in the domain's DNS: you, or a colleague you send them to. This page is public so that they can read it without an account.
- Who may manage domains: An account key or a console session. An inbox-scoped key gets `403 forbidden`, and an app authorized through OAuth gets `403 insufficient_scope`: no permission delegates domains. In an [organization](https://doorman.fyi/docs/organizations.md#operations), every member can read the domains, and adding, checking, setting up or removing one from the console takes the member's `domains:manage`.

## Adding the domain

In the console, open [Domains](https://doorman.fyi/console/domains), type the domain and choose Continue: the page then walks through the setup one step at a time (connect it, wait for the check, choose the first address). Typing a registered domain such as `example.com` offers a name under it first. Ask Doorman can do the same from a sentence: tell it the domain, confirm the one change it proposes, and it opens the setup for you. Through the API, [`POST /v1/domains`](https://doorman.fyi/docs/reference/domains.md#domains-create) takes the name:

curl:
```sh
curl -s -X POST "https://api.doorman.fyi/v1/domains" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "name": "agents.example.com"
  }'
```

The answer is `201` with the [`Domain`](https://doorman.fyi/docs/reference/schemas.md#Domain): its `id`, the `status` (`pending`), the `records` to publish, and `expiresAt`, the instant the domain is removed if it has not verified by then.

201 Created:
```json
{
  "id": "dom_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "name": "agents.example.com",
  "status": "pending",
  "transport": "resend",
  "records": [
    {
      "record": "MX",
      "host": "agents.example.com",
      "type": "MX",
      "value": "inbound-smtp.mail.example",
      "priority": 10,
      "ttl": 300,
      "required": true,
      "status": "pending"
    },
    {
      "record": "SPF",
      "host": "send.agents.example.com",
      "type": "MX",
      "value": "feedback-smtp.mail.example",
      "priority": 10,
      "ttl": 300,
      "required": true,
      "status": "pending"
    },
    {
      "record": "SPF",
      "host": "send.agents.example.com",
      "type": "TXT",
      "value": "v=spf1 include:mail.example ~all",
      "priority": null,
      "ttl": 300,
      "required": true,
      "status": "pending"
    },
    {
      "record": "SPF",
      "host": "rsend.agents.example.com",
      "type": "CNAME",
      "value": "return-path.mail.example",
      "priority": null,
      "ttl": 300,
      "required": true,
      "status": "pending"
    },
    {
      "record": "DKIM",
      "host": "resend._domainkey.agents.example.com",
      "type": "TXT",
      "value": "p=MIGfMA0GCSqGSIb3DQEB...",
      "priority": null,
      "ttl": 300,
      "required": true,
      "status": "pending"
    },
    {
      "record": "DMARC",
      "host": "_dmarc.agents.example.com",
      "type": "TXT",
      "value": "v=DMARC1; p=none;",
      "priority": null,
      "ttl": 300,
      "required": false,
      "status": "not_started"
    }
  ],
  "connect": {
    "available": false,
    "setupType": null,
    "propagationStatus": null,
    "provider": null
  },
  "inboxes": 0,
  "verifiedAt": null,
  "expiresAt": "2026-11-12T10:05:00.000Z",
  "lastCheckedAt": null,
  "createdAt": "2026-11-05T10:05:00.000Z",
  "updatedAt": "2026-11-05T10:05:00.000Z"
}
```

> Warning: Prefer a subdomain such as `agents.example.com` to the registered domain itself. The receiving record is an MX on the name you add, and an MX takes all mail for that name: adding `example.com` would route every mailbox at `example.com` to the inbox platform, the ones your team uses today included.

### Which names are accepted

The name is trimmed and lowercased, and a trailing dot is dropped. It is at most 253 characters of lowercase letters, digits and hyphens in labels separated by dots, with at least two labels; an internationalized name goes in its punycode form. These are refused with `400 validation_error`, because nobody who asks could publish their records:

- an IP address;
- a name that does not resolve on the public internet: anything ending in `.arpa`, `.internal`, `.invalid`, `.local`, `.localhost`, `.onion`;
- a bare registry suffix such as `co.uk` or `com.au` (a domain registered under one, such as `acme.co.uk`, is fine);
- a shared hosting platform's domain and every name under it, such as `github.io` or `vercel.app`: its customers get a host name there, never its DNS;
- the shared domain `doorman.example`, the hosts this service itself answers on, and every name under them.

A domain belongs to one account at a time. A name another account holds answers `409 already_exists`, and so does a name that is registered at the mail transport under another of its accounts: remove it there first, or add a subdomain of it. An account may add 20 domains every 24 hours, removed ones included (`429 rate_limit_exceeded` with `Retry-After`); a refused name or a plan limit does not count.

## The records to publish

A domain's `records` are everything its DNS needs. Each one has the `host` to publish on as a full name, the DNS `type` (`MX`, `TXT` or `CNAME`), the `value`, a `priority` on the MX records, a `ttl` in seconds, whether it is `required`, and its own `status`. `record` says what it is: `MX` for receiving, `SPF` for every record of the return path, `DKIM` or `DMARC`. The console names them as below.

| Record | Published on | What it is for |
| --- | --- | --- |
| Receiving, an MX record, required | the domain itself | Mail for the domain is delivered to the inbox platform. |
| Return path, an MX or a CNAME record, required | `send.<domain>`, and for a CNAME also a sibling name such as `rsend.<domain>` | Where bounces of the mail you send are reported. A CNAME hands the whole name to the mail transport, which then answers for it. |
| SPF, a TXT record, required | `send.<domain>` | Says which servers may send for the return path. |
| DKIM, a TXT record, required | a selector under `_domainkey.<domain>` | The public key your outbound mail is signed with. |
| DMARC, a TXT record, recommended | `_dmarc.<domain>` | The policy receivers apply. The suggested value only observes (`p=none`), so a wrong record never blocks the domain's other mail. |

How many return-path records a domain has is the mail transport's to say, and it differs between domains: an MX and a TXT, CNAME records in their place, or both kinds at once. Publish every record the domain lists. Each required one counts, and the domain verifies when all of them are found.

The values are particular to your domain. Copy them from the answer, or from the domain's page in the console, where every row has a copy control and Copy all records gives the whole set as text for whoever manages your DNS.

> Note: Hosts are full names. Many DNS providers want only the part before the domain they manage: for `agents.example.com` at a provider that manages `example.com`, that is `agents` for the receiving record and `send.agents` for the return path. A full name entered where a relative one is expected is published as `agents.example.com.example.com` and is never found.

> Note: Publish a CNAME record as DNS only. Some DNS providers can put a proxy in front of a record. Behind one, the name answers with the proxy's own address, the records the CNAME points to are never seen, and the domain does not verify.

Look at what the name already has before adding them. An existing MX on the same name competes with the receiving record, so mail would go to either server: remove it unless you mean to keep the old one. A host takes one SPF record; `send.<domain>` normally has none. A name that holds a CNAME can hold nothing else, so the name a CNAME goes on has to be free of other records. If `_dmarc.<domain>` already holds a policy, keep yours: the domain verifies without the suggested one.

## Publishing them automatically

Where the deployment offers it (`features.domainConnect` in `GET /v1/me`), the second step of the domain's setup in the console is Connect automatically. It opens a window from a third-party DNS setup service, in which you sign in to your DNS provider and approve the records. They are added for you where the provider supports it; where it does not, the same window shows where to enter them.

- You sign in to your DNS provider inside that window, not in the console. The console never sees or stores that sign-in.
- The window is given this domain's records and a token that is valid for one hour. The service's secret never leaves the API.
- When the window closes, the console asks for a verification check. What the setup service reports is advisory: only the mail transport's own check of the records makes the domain verified.
- It is a console feature. Through the API, publish the records yourself and ask for a check.

## Publishing them by hand

1. Open the DNS settings of the domain at the provider that manages it. That is where its name servers point, which is not always where the domain was bought.
2. Add each record with its type, host and value, and the priority on the MX records. Enter every value whole; the DKIM key is one long string. Where the provider offers to proxy a CNAME record, leave that off.
3. Leave the TTL at the provider's default, or use 300 seconds while you are setting up.
4. Save, then ask for a check: I added the records, check now on the domain's page, or the call below.

curl:
```sh
curl -s -X POST "https://api.doorman.fyi/v1/domains/dom_01jc5f1a2b3c4d5e6f7g8h9j0k/verify" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

## Verification

Verification is asynchronous. [`POST /v1/domains/{domainId}/verify`](https://doorman.fyi/docs/reference/domains.md#domains-verify) asks the mail transport to look at the records and answers `202` with the domain as it stands; the outcome arrives later. One request per domain every 30 seconds; a sooner one answers `429 rate_limit_exceeded` with `Retry-After`.

You do not have to ask. The transport reports changes as it sees them, pending domains are read again every 15 minutes as a safety net, and the domain's page in the console refreshes while it waits. DNS changes can take up to an hour to show.

- `pending`: The required records have not all been found yet. Every domain starts here.
- `verified`: Every required record checks out. The domain receives and sends, and inboxes can be created on it.
- `failed`: A required record could not be found, or does not match. Compare each record's `status` and value with what your DNS provider shows, correct it, and check again.

Each record carries its own `status`: `not_started`, `pending`, `verified` or `failed`. The domain verifies when the receiving record, every return-path record and the DKIM key are found; the DMARC record is recommended, never required. No event announces it yet: read the domain with [`GET /v1/domains/{domainId}`](https://doorman.fyi/docs/reference/domains.md#domains-get) until its `status` changes.

curl:
```sh
curl -s "https://api.doorman.fyi/v1/domains/dom_01jc5f1a2b3c4d5e6f7g8h9j0k" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

## 7 days to verify

A domain that has never verified is removed 7 days after it was added; its `expiresAt` says when. It is removed here and at the mail transport, and its name is free again for whoever can publish its records, you included. A domain can hold inboxes only once it has verified, so an expiry takes no inbox with it.

A domain that has verified once is never removed this way, whatever its records do later, and its `expiresAt` is null. If its records stop checking out, its status goes back to `pending` or `failed` and its inboxes stay: sending from them answers `503 sending_unavailable` and creating new ones answers `409 domain_not_verified` until the records verify again.

## Inboxes on your domain

Once the domain is verified, [`POST /v1/inboxes`](https://doorman.fyi/docs/reference/inboxes.md#inboxes-create) takes its id as `domainId` and issues the address on it. Everything else about the inbox is the same: it receives as soon as it exists, and its threads, keys, webhook and events work as on the shared domain. In the console, the domain's page offers the first inbox, and the New inbox sheet lists every verified domain.

curl:
```sh
curl -s -X POST "https://api.doorman.fyi/v1/inboxes" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "mailboxName": "concierge",
    "displayName": "Acme concierge",
    "domainId": "dom_01jc5f1a2b3c4d5e6f7g8h9j0k"
  }'
```

- Names: On your own domain only the mail-infrastructure names are reserved, such as `postmaster`, `abuse` and `no-reply`: the list [reserved everywhere](https://doorman.fyi/docs/inboxes.md#names). Role names such as `support` and `billing` are yours to use, and a display name may be a bare role.
- Allowance: An inbox on a custom domain counts toward the plan's inbox allowance and the account ceiling like any other.
- Unknown names: Mail to a name on your domain that is not an inbox cannot be refused at the mail server, because the transport has already accepted it: it is dropped without a bounce. The shared domain refuses unknown names at once.
- Sending: Messages leave from the address on your domain, signed with the domain's DKIM key. The per-inbox limits apply; the account's daily cap on the shared domain does not. See [Sending and replying](https://doorman.fyi/docs/sending.md#limits).
- Apps: An app authorized through OAuth cannot create an inbox on a custom domain. It reads and operates the inboxes that live there through its mail permissions.

## Downgrades and removal

After a downgrade to a plan without custom domains, the domains and their inboxes stay and keep receiving. Sending from them, adding domains and creating inboxes on them answer `402 plan_limit_reached` with `scope: "domains"` until the plan covers them again.

[`DELETE /v1/domains/{domainId}`](https://doorman.fyi/docs/reference/domains.md#domains-delete) answers `204` and removes the domain with every inbox on it, exactly as deleting each inbox would: the addresses stop receiving and stay held for your account, their keys are revoked, their webhooks removed and their streams closed. The domain is removed at the mail transport afterwards. The records at your DNS provider are not touched; remove them yourself.

## When a domain call is refused

| Status | Error | Meaning |
| --- | --- | --- |
| 400 | `validation_error` | A field is missing or invalid; the message names it. |
| 402 | `plan_limit_reached` | The plan's allowance is used up; `scope` says whether it is the inbox count, the monthly sends or the custom domains. Upgrade rather than wait. |
| 409 | `limit_reached` | The abuse ceiling for inboxes, custom domains, keys, endpoints, services, relying parties, the services an address signs in to, the sends an inbox has waiting for its owner or the invitations an organization has open; delete, revoke or decide one first. |
| 409 | `already_exists` | The mailbox name or the `externalId` is already in use (`field` says which), or another account holds the custom domain, here or at the mail transport. |
| 409 | `domain_not_verified` | The custom domain has not verified its required DNS records. |
| 429 | `rate_limit_exceeded` | A per-inbox or per-account rate limit; `Retry-After` and `resetsAt` say when to try again. |
| 502 | `provider_unavailable` | The mail transport, the DNS setup provider or the payment provider did not answer, or refused this deployment's credentials. |
| 503 | `custom_domains_unavailable` | The custom-domain mail transport and inbound webhook are not fully configured. |
| 503 | `connect_unavailable` | Automatic DNS setup is not configured; publish the records manually. |

A `502 provider_unavailable` is never about the request: the transport or the setup service did not answer, or refused the deployment's own credentials, which only the operator can fix. The reference lists every code each route answers, starting with [`POST /v1/domains`](https://doorman.fyi/docs/reference/domains.md#domains-create).
