# Domains (/docs/email/domains)

Live keys can only send from domains your organization has verified. Domains belong to the
organization and are shared by all of its projects.

## Adding a domain [#adding-a-domain]

Add the domain in the dashboard (**Domains**) or through the API, then publish the DNS records it
returns at your DNS provider:

```ts twoslash
import { Coss } from "coss";
const coss = new Coss();
// ---cut---
const { data: domain, error } = await coss.domains.create({ name: "acme.com" });

for (const record of domain?.records ?? []) {
  console.log(record.type, record.name, record.value);
}
```

### Bounce subdomain [#bounce-subdomain]

The bounce hostname defaults to `send.<domain>`. If Resend or another provider already uses that
hostname, choose a different **Bounce subdomain** when adding the domain. Enter a single DNS
label such as `coss-bounce`. For `acme.com`, coss.com will use `coss-bounce.acme.com` for bounces
and provide the MX and SPF records for that hostname in `records`.

With the SDK, pass `{ name: "acme.com", mail_from_subdomain: "coss-bounce" }` to
`coss.domains.create()`. The CLI flag is `--mail-from-subdomain`. Verification retries keep the
label chosen when the domain was added.

| Purpose              | Type    | Name                              | Value                                    |
| -------------------- | ------- | --------------------------------- | ---------------------------------------- |
| DKIM (three records) | `CNAME` | `<token>._domainkey.example.com`  | `<token>.dkim.amazonses.com`             |
| MAIL FROM            | `MX`    | `send.example.com`                | `feedback-smtp.<region>.amazonses.com` (priority 10) |
| MAIL FROM SPF        | `TXT`   | `send.example.com`                | `v=spf1 include:amazonses.com ~all`      |
| DMARC (recommended)  | `TXT`   | `_dmarc.example.com`              | `v=DMARC1; p=none; rua=mailto:dmarc-<token>@inbound.coss.com;` |

Copy the exact values from the dashboard or the `records` array: the DKIM tokens, the region and
the DMARC report address are specific to your domain. The DMARC record starts in monitoring mode
(`p=none`) and sends aggregate reports to coss.com; [DMARC](/docs/email/dmarc) explains the reports and
the path to `p=reject`. Showing your logo with [BIMI](/docs/email/bimi) needs `p=quarantine` or
`p=reject`.

### One-click setup [#one-click-setup]

If your DNS provider supports [Domain Connect](https://www.domainconnect.org), the domain's page in
the dashboard shows **Connect with** your provider (Cloudflare, for example). It takes you to your
provider, which lists the records coss.com would add and asks you to confirm; then you're back on the
domain's page and coss.com checks the records right away. Only the records still missing are added,
and a DMARC record only when your domain has none (its own or its parent domain's), so an existing
policy is never weakened. If you chose a custom bounce subdomain, add its MX and SPF records
manually. Records for [receiving email](/docs/email/receiving) are also added manually.

## Verification [#verification]

coss.com checks the records automatically; the dashboard and each record's `status` show the result of
the last check, and `can_send` says whether live keys may send from the domain. Verification
usually takes minutes, but DNS changes can take longer to propagate. If a domain is not verified
within 72 hours, verification fails. Restarting it (**Verify** in the dashboard, or
`coss.domains.verify(id)`) issues new DKIM records to publish.

When several organizations verify overlapping domains, the most specific one decides who may send:
verifying `mail.example.com` lets you send from `@mail.example.com` even if someone else verified
`example.com`.

## Tracking domain [#tracking-domain]

A verified domain can serve open and click tracking links from its own subdomain, such as
`links.acme.com`. See [custom tracking domains](/docs/email/tracking#custom-tracking-domains).

## Brand logo (BIMI) [#brand-logo-bimi]

With your own VMC or CMC certificate, mailbox providers such as Gmail and Apple Mail can show your
logo next to your emails. coss.com checks the BIMI record and DMARC policy with the domain's other
records and reports the result in the domain's `bimi` field. See [brand logos (BIMI)](/docs/email/bimi).
