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

# Custom domain

> Send emails from your own domain for better deliverability and branding.

When you add a domain to Dreamlit, you can send emails from your own brand (like `hello@yourapp.com`) instead of Dreamlit's default sender.

This improves deliverability and looks more professional to your users. You'll need access to your domain's DNS settings to add a few essential records (DKIM, SPF, DMARC) that signal to email providers that your emails are legitimate.

## Setup

Go to **Settings → Email Domains** and click **Add domain**. Enter your domain—we recommend a subdomain like `mail.yourapp.com`.

From there, you can verify your domain automatically or manually.

***

### Automatic setup (recommended)

Dreamlit can configure your DNS records for you. Just click **Verify with your DNS provider**, sign in to your provider, and authorize the changes.

<Frame caption="Automatic DNS setup—no manual records needed">
  <img src="https://mintcdn.com/notikaai/ND5vtH9yB3HGk0VQ/images/auto-dns.gif?s=ce1cca7fadcd17e41cb37a8fdce2753d" alt="Automated DNS verification flow" width="1024" height="720" data-path="images/auto-dns.gif" />
</Frame>

Once authorized, Dreamlit adds the required records and verifies your domain automatically. You're ready to send.

<Note>
  Automatic setup is available for supported DNS providers. If your provider isn't listed, use manual setup below.
</Note>

***

### Manual setup

If your DNS provider isn't supported for automatic setup, you can add the records manually. Dreamlit shows you exactly what to add.

<Steps>
  <Step title="Copy the DNS records from Dreamlit">
    After adding your domain, Dreamlit generates the required DNS records (DKIM, SPF, DMARC). Copy these to add to your DNS provider.
  </Step>

  <Step title="Add records to your DNS provider">
    Log in to your DNS provider and add each record. Here are instructions for common providers:

    <AccordionGroup>
      <Accordion title="Cloudflare">
        1. Go to the DNS tab in your Cloudflare dashboard.
        2. Add a new record for each entry shown in Dreamlit:
           * **Type**: CNAME or TXT (depending on the record)
           * **Name**: Provided by Dreamlit
           * **Value**: Provided by Dreamlit
        3. Save your changes and wait for propagation.

        <Warning>
          **Important for Cloudflare users**: When adding email-related DNS records (SPF, DKIM, DMARC, MX, and CNAME records),
          select 'DNS Only' (gray cloud icon) and not proxied. The Cloudflare proxy must be bypassed for these records to function properly.
        </Warning>
      </Accordion>

      <Accordion title="GoDaddy">
        1. In GoDaddy, open the DNS Management page.
        2. Click **Add** under "Records."
        3. Enter the record details from Dreamlit, including Host (Name) and Value.
        4. Save the record and wait for DNS propagation.
      </Accordion>

      <Accordion title="Namecheap">
        1. Navigate to **Domain List** → **Manage** → **Advanced DNS**.
        2. Add each Dreamlit record in **Host Records**.
        3. Save records and wait for propagation (usually a few minutes to a few hours).

        <Warning>
          **If Namecheap says the DKIM host is too long**

          This is the 60-character **Host** limit. Do not shorten or modify the DKIM token. Remove only `.yourdomain.com` from **Host**, then try again.

          Example for `dreamlit.ai`:

          ```text theme={null}
          <token>._domainkey.mail.dreamlit.ai  ->  <token>._domainkey.mail
          ```

          Keep **Value** unchanged (for example: `<token>.dkim.amazonses.com`).
        </Warning>
      </Accordion>
    </AccordionGroup>
  </Step>

  <Step title="Verify in Dreamlit">
    Once you've added all the required DNS records, return to Dreamlit's **Email Domains** page and click **Verify** next to your domain.

    <Accordion title="Troubleshooting: Verify your DNS records">
      If verification fails, you can confirm your DNS records are set up correctly using these commands or a free DNS lookup service like [MXToolbox](https://mxtoolbox.com/DNSLookup.aspx).

      <AccordionGroup>
        <Accordion title="macOS / Linux" defaultOpen>
          ```bash theme={null}
          # Check MX records
          dig MX mail.mydomain.com

          # Check SPF record
          dig TXT mail.mydomain.com

          # Check DMARC record
          dig TXT _dmarc.mail.mydomain.com

          # Check DKIM records
          dig CNAME dk1._domainkey.mail.mydomain.com
          dig CNAME dk2._domainkey.mail.mydomain.com
          dig CNAME dk3._domainkey.mail.mydomain.com
          ```

          Replace `mail.mydomain.com` with your actual domain.
        </Accordion>

        <Accordion title="Windows">
          ```bash theme={null}
          # Check MX records
          nslookup -type=mx mail.mydomain.com

          # Check SPF record
          nslookup -type=txt mail.mydomain.com

          # Check DMARC record
          nslookup -type=txt _dmarc.mail.mydomain.com

          # Check DKIM records
          nslookup -type=cname dk1._domainkey.mail.mydomain.com
          nslookup -type=cname dk2._domainkey.mail.mydomain.com
          nslookup -type=cname dk3._domainkey.mail.mydomain.com
          ```

          Replace `mail.mydomain.com` with your actual domain.
        </Accordion>
      </AccordionGroup>
    </Accordion>
  </Step>

  <Step title="Start sending">
    Once verified, select your domain when creating email workflows. Your emails will now come from your own brand.
  </Step>
</Steps>

<Warning>
  DNS changes can take up to 24-48 hours to fully propagate. If verification fails immediately, wait a bit and try again.
</Warning>

***

## Why these records matter

We want you to have the best possible email deliverability. The records you add serve different purposes:

* **DKIM** (DomainKeys Identified Mail): Attaches a cryptographic signature to your outgoing emails, proving they originated from your domain and haven't been tampered with.
* **SPF** (Sender Policy Framework): Specifies which mail servers are allowed to send emails on behalf of your domain. This helps receiving servers know legitimate senders.
* **DMARC** (Domain-based Message Authentication, Reporting, and Conformance): Builds on SPF and DKIM to give you greater control over how ISPs handle unauthenticated mail from your domain.

<Check>
  You're all set! Domain-verified email sends are an excellent step toward building trust and ensuring your notifications reach the inbox.
</Check>
