Domains and DNS

Add a sending domain to exx.sh, publish its DKIM and return-path records, and get it verified. Includes DNS provider tips and every verification status.

exx.sh sends only from domains you have verified. You add a domain to a project, publish the three DNS records exx.sh gives you, and exx.sh verifies them. From then on any address on the domain can be a from address, and you never change those records again.

Add a domain

Add the domain in the dashboard under Domains, or with POST /domains. The answer lists the records to publish:

import { Exx } from "@exx.sh/sdk";

const exx = new Exx(process.env.EXX_API_KEY);

const { data, error } = await exx.domains.create({ name: "acme.com" });
if (error) throw new Error(`${error.name}: ${error.message}`);

// Add these records at your DNS provider, then ask for a check.
for (const r of data.records ?? []) console.log(r.type, r.name, r.value);
await exx.domains.verify(data.id);
console.log(data.id);

A domain verified by one project cannot be added by another: the API answers 403 validation_error, "The acme.com domain has been registered already."

The records

For acme.com the records look like this; <id> is your domain's own identifier, shown in the dashboard and the API answer:

TypeNameValueRequired
CNAMEexx1._domainkey<id>-exx1.dkim.mail.exx.shyes
CNAMEexx2._domainkey<id>-exx2.dkim.mail.exx.shyes
CNAMEbounces<id>.rp.mail.exx.shyes
TXT_dmarcv=DMARC1; p=none;recommended

The two DKIM records point at signing keys that exx.sh holds. exx.sh signs every message with them, aligned to your domain, and replaces the keys every 180 days (2048-bit RSA) behind the same record names, so you never edit these records.

The return-path record makes bounces.acme.com point at exx.sh. That name carries the SPF record and the bounce MX in our zone: bounces and complaints come back to exx.sh, and your domain's own SPF record stays as it is. To use another name than bounces, set custom_return_path when you create the domain.

DMARC is yours to set, and optional: the domain verifies and sends without it, and the API marks its record required: false. Each check looks it up too: one record at _dmarc.<your domain> that starts with v=DMARC1 and states a policy (p=none, quarantine or reject) shows as verified, so keep your own policy if you have one. While DMARC reports are on, the record's rua tag must also name the report address; until it does, the record shows as pending. Without a record it stays not_started. Start with p=none to receive reports without affecting delivery, then tighten the policy once the reports look clean. Because exx.sh signs with DKIM aligned to your domain, its mail passes DMARC. exx.sh can receive and sum up those reports for you: see DMARC reports.

Publish the records

Every DNS provider has a form for new records. Three things go wrong most often:

  1. The name. The names above are relative to your domain. Most providers add the domain for you, so enter exx1._domainkey, not exx1._domainkey.acme.com; with a provider that wants the full name, enter the full name.
  2. The proxy. At Cloudflare, set each record to DNS only. A proxied CNAME answers with Cloudflare's addresses instead of exx.sh's records.
  3. A name already in use. A CNAME cannot share its name with another record. If bounces.acme.com already exists, choose another custom_return_path.

To see what the world sees, query a public resolver:

dig +short CNAME exx1._domainkey.acme.com @1.1.1.1

Verification

exx.sh asks public resolvers for each record. It checks a pending domain on a schedule: the wait between checks starts at 1 minute and doubles up to 1 hour, until every required record matches. Each change of status sends a domain.updated webhook. POST /domains/{id}/verify or Verify in the dashboard asks for a check now. A verified domain is checked again every 24 hours.

The domain and each record have a status:

StatusMeans
not_startedNot checked yet.
pendingA record is missing or has another value. DNS changes can take a while to reach every resolver.
verifiedEvery required record matches. Mail can be sent from the domain.
temporary_failureA lookup was inconclusive, for example a DNS server timed out. exx.sh checks again later.
failedThe records did not match within 72 hours. Fix them and verify again.

The dashboard shows each record's status next to its value, and GET /domains/{id} returns the same.

Region and tracking

Domains live in eu-west-1, our only region; another region answers 422 invalid_region. open_tracking and click_tracking are supported on create and update, independently, and both default to false. The project's tracking scope defaults to broadcasts; choose all to include other API sends from tracking-enabled domains.

Set tracking_subdomain: "links" for a custom hostname such as links.acme.com. The domain's records then includes a Tracking CNAME to t.exx.sh, plus any ownership TXT records required. Provisioning waits for domain verification and an active hostname and TLS certificate; until then links use the shared host. Unsubscribe links always stay on t.exx.sh. See custom tracking hostnames.

Common questions

Do I need to change my SPF record?

No. SPF is checked on the return-path domain, bounces.acme.com, which points at exx.sh. Your domain's own SPF record does not need exx.sh in it.

Can I send from a subdomain?

Yes. Add the subdomain, for example mail.acme.com, as a domain of its own; its records go under that name. Many senders keep transactional mail on a subdomain so that its reputation stays separate from the main domain's.

Why is my domain still pending?

One of the records does not match yet. Compare each record in the dashboard with the dig output above: a doubled domain in the name (exx1._domainkey.acme.com.acme.com) or a Cloudflare proxy are the usual causes. After a fix, select Verify to check at once.

On this page