> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackshift.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Sender domains and DNS

> Create and verify outbound sender domains, inspect SPF, DKIM, DMARC, and return-path record status, and know what the domain status fields mean.

<Tip>
  **Live.** This area is documented as current, user-reliable behavior.
</Tip>

## Goal

Move a domain from pending to verified before using it as a production sender.

## Prerequisites

* DNS control for the sender domain
* A StackShift API key

## Workflow

<Steps>
  <Step>
    Create the sender domain with /mail/domains or the SDK.
  </Step>

  <Step>
    Publish every required DNS record returned by StackShift.
  </Step>

  <Step>
    Run verify after DNS propagation.
  </Step>

  <Step>
    Use the domain only after the aggregate status is verified.
  </Step>
</Steps>

## Domain API

```ts theme={null}
const domain = await stackshift.mail.domains.create('example.com')

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

const checked = await stackshift.mail.domains.verify(domain.id)
console.log(checked.status, checked.spfStatus, checked.dkimStatus, checked.dmarcStatus, checked.returnPathStatus)
```

## Status fields

* domain.status is pending, verified, failed, or disabled.
* spfStatus, dkimStatus, dmarcStatus, and returnPathStatus are missing, pending, verified, or failed.
* records contains DNS records with type, name, value, status, required, and optional explanation.
* Deleting a domain removes it from the StackShift sender-domain registry. It does not delete DNS records at your DNS provider.

## Record types currently surfaced

* TXT records are used for SPF or DMARC-style policy data.
* CNAME records are used for delegated verification or return-path style routing.
* MX records are used where mail routing requires them, especially inbound domain workflows.

## Expected result

<Check>
  The sender domain has status verified and individual SPF, DKIM, DMARC, and return-path checks are not missing or failed.
</Check>

## Common failures

<Warning>
  * TXT or CNAME records were copied with the wrong host/name value.
  * DNS propagation has not completed when verify is run.
  * The domain remains failed or pending because one required record is missing.
</Warning>

## Related guides

<CardGroup cols={2}>
  <Card title="Send email" href="/stackshift-mail/send-email">
    Send a single outbound email with the official SDK or REST API, then inspect the message, attempts, logs, and timeline.
  </Card>

  <Card title="Bounces, suppressions, and reputation" href="/stackshift-mail/bounces-suppressions-and-reputation">
    Handle hard and soft bounces, workspace-scoped suppressions, sending limits, warmup stage, domain reputation, and reputation events.
  </Card>

  <Card title="Scheduled, batch, inbound, attachments, and analytics" href="/stackshift-mail/scheduled-batch-inbound-and-analytics">
    Use the Mail APIs for scheduled delivery, batch sending, batch-template sending, inbound domain capture, asset-backed attachments, and aggregate analytics.
  </Card>
</CardGroup>
