---
title: "How to Set Up SPF, DKIM, and DMARC"
url: https://docs.mailbeast.ai/en/articles/28-how-to-set-up-spf-dkim-and-dmarc
collection: "DNS & Infrastructure"
updated: 2026-11-04
language: en
---

# How to Set Up SPF, DKIM, and DMARC

SPF, DKIM, and DMARC are the three DNS records that prove your emails are legitimate. Together, they answer three questions every receiving server asks: _who is allowed to send for this domain, was the message tampered with in transit,_ and _what should we do if either check fails?_

Since [February 2024, Google and Yahoo require all three](https://support.google.com/mail/answer/81126) for any sender pushing more than a few hundred messages per day from one mailbox. In cold email you'll rarely send more than 20-30 a day from a single account anyway, so the volume threshold itself isn't the point. The point is that the rules are tightening across the board: a clean technical setup is no longer "nice to have", it's a MUST. Without SPF, DKIM, and DMARC your campaigns will land in spam, or be rejected outright.

The good news: setup is a one-time task per domain, and most of the work depends on which Email Service Provider (ESP) you use. SPF and DKIM are configured **per provider**. DMARC is configured **once**, regardless of provider.

This guide walks through both halves.

* * *

## What Each Record Does

-   **SPF** publishes the list of mail servers authorized to send on behalf of your domain. Receivers check the sending IP against this list.
    
-   **DKIM** attaches a cryptographic signature to every outgoing email. Receivers verify the signature against a public key in your DNS, proving the message came from you and was not modified.
    
-   **DMARC** tells receivers what to do when SPF or DKIM fails (allow, quarantine, or reject) and where to send authentication reports.
    

SPF and DKIM are the proof. DMARC is the policy that turns that proof into action.

* * *

## How to Set Up SPF and DKIM

Each ESP has its own settings for SPF and DKIM. The general flow is the same everywhere: generate keys in the ESP's admin panel, then publish DNS records on your domain. Specific values differ. Pick your provider below.

### Google Workspace

> **Info:** Official docs: [Authorize email senders with SPF](https://support.google.com/a/answer/33786) and [Turn on DKIM for your domain](https://support.google.com/a/answer/174124) (Google Workspace Admin Help).

**SPF.** Add a TXT record on your root domain.

-   **Host / Name:** `@` (root)
    
-   **Type:** TXT
    
-   **Value:** `v=spf1 include:_spf.google.com ~all`
    

**DKIM.**

1.  Go to [Google Admin Console](https://admin.google.com).
    
2.  Navigate to **Apps > Google Workspace > Gmail > Authenticate Email**.
    
3.  Select your domain and click **Generate New Record**. Choose **2048-bit** key length.
    
4.  Copy the TXT record value Google provides.
    
5.  Add a TXT record to your DNS:
    
    -   **Host / Name:** `google._domainkey`
        
    -   **Value:** the TXT value from Google
        
6.  Return to Google Admin Console and click **Start Authentication**.
    

> **Error:** **Important:** The DNS record alone is not enough. You must click **Start Authentication** in Google Admin or Google will not sign your outgoing mail.

### Microsoft 365

> **Info:** Official docs: [Set up SPF for Microsoft 365](https://learn.microsoft.com/en-us/defender-office-365/email-authentication-spf-configure) and [Use DKIM for email in your custom domain](https://learn.microsoft.com/en-us/defender-office-365/email-authentication-dkim-configure) (Microsoft Learn).

**SPF.** Add a TXT record on your root domain.

-   **Host / Name:** `@` (root)
    
-   **Type:** TXT
    
-   **Value:** `v=spf1 include:spf.protection.outlook.com -all` (Microsoft recommends `-all` over `~all` once DKIM and DMARC are in place)
    

**DKIM.**

1.  Go to the [Microsoft Defender portal](https://security.microsoft.com/authentication?viewid=DKIM).
    
2.  Navigate to **Email & collaboration > Policies & rules > Threat policies > Email Authentication Settings > DKIM**.
    
3.  Select your domain and click **Create DKIM keys**.
    
4.  Microsoft gives you two CNAME records, add both to your DNS:
    
    -   `selector1._domainkey.yourdomain.com` -> `selector1-yourdomain-com._domainkey.<initial>.<x>-v1.dkim.mail.microsoft`
        
    -   `selector2._domainkey.yourdomain.com` -> `selector2-yourdomain-com._domainkey.<initial>.<x>-v1.dkim.mail.microsoft`
        

The exact target values are shown in the **Publish CNAMEs** flyout. As of May 2025, new tenants get the updated `<x>-v1.dkim.mail.microsoft` format with a dynamic partition character. Older tenants still use the legacy `<initial>.onmicrosoft.com` format. Always copy the values shown in the portal, not from a template.

1.  After DNS propagation, return to Microsoft Defender and toggle **Enable** for DKIM.
    

### Other Providers

The pattern is the same for every ESP. Common ones, with links to their official setup docs:

<table style="min-width: 75px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><th colspan="1" rowspan="1" style="vertical-align: middle;"><p>Provider</p></th><th colspan="1" rowspan="1" style="vertical-align: middle;"><p>SPF Include</p></th><th colspan="1" rowspan="1" style="vertical-align: middle;"><p>Official DKIM/SPF Docs</p></th></tr><tr><td colspan="1" rowspan="1" style="vertical-align: middle;"><p>Zoho Mail</p></td><td colspan="1" rowspan="1" style="vertical-align: middle;"><p><code>include:zoho.com</code></p></td><td colspan="1" rowspan="1" style="vertical-align: middle;"><p><a target="_blank" rel="noopener noreferrer nofollow" class="linktype-link link" data-linktype="link" href="https://www.zoho.com/mail/help/adminconsole/spf-configuration.html">SPF</a> / <a target="_blank" rel="noopener noreferrer nofollow" class="linktype-link link" data-linktype="link" href="https://www.zoho.com/mail/help/adminconsole/dkim-configuration.html">DKIM</a></p></td></tr><tr><td colspan="1" rowspan="1" style="vertical-align: middle;"><p>Namecheap Private Email</p></td><td colspan="1" rowspan="1" style="vertical-align: middle;"><p><code>include:spf.privateemail.com</code></p></td><td colspan="1" rowspan="1" style="vertical-align: middle;"><p><a target="_blank" rel="noopener noreferrer nofollow" class="linktype-link link" data-linktype="link" href="https://www.namecheap.com/support/knowledgebase/article.aspx/9214/2237/setting-up-spf-records-for-private-email/">SPF &amp; DKIM</a></p></td></tr><tr><td colspan="1" rowspan="1" style="vertical-align: middle;"><p>GoDaddy Email</p></td><td colspan="1" rowspan="1" style="vertical-align: middle;"><p><code>include:secureserver.net</code></p></td><td colspan="1" rowspan="1" style="vertical-align: middle;"><p><a target="_blank" rel="noopener noreferrer nofollow" class="linktype-link link" data-linktype="link" href="https://www.godaddy.com/help/add-an-spf-record-19213">Email DNS records</a></p></td></tr><tr><td colspan="1" rowspan="1" style="vertical-align: middle;"><p>SendGrid</p></td><td colspan="1" rowspan="1" style="vertical-align: middle;"><p><code>include:sendgrid.net</code></p></td><td colspan="1" rowspan="1" style="vertical-align: middle;"><p><a target="_blank" rel="noopener noreferrer nofollow" class="linktype-link link" data-linktype="link" href="https://www.twilio.com/docs/sendgrid/ui/account-and-settings/how-to-set-up-domain-authentication">Sender Authentication</a></p></td></tr><tr><td colspan="1" rowspan="1" style="vertical-align: middle;"><p>Mailgun</p></td><td colspan="1" rowspan="1" style="vertical-align: middle;"><p><code>include:mailgun.org</code></p></td><td colspan="1" rowspan="1" style="vertical-align: middle;"><p><a target="_blank" rel="noopener noreferrer nofollow" class="linktype-link link" data-linktype="link" href="https://documentation.mailgun.com/docs/mailgun/user-manual/sending-messages/#verifying-your-domain">DNS records for sending</a></p></td></tr><tr><td colspan="1" rowspan="1" style="vertical-align: middle;"><p>Amazon SES</p></td><td colspan="1" rowspan="1" style="vertical-align: middle;"><p><code>include:amazonses.com</code></p></td><td colspan="1" rowspan="1" style="vertical-align: middle;"><p><a target="_blank" rel="noopener noreferrer nofollow" class="linktype-link link" data-linktype="link" href="https://docs.aws.amazon.com/ses/latest/dg/send-email-authentication-dkim.html">DKIM signing in SES</a></p></td></tr></tbody></table>

The flow:

1.  Find your ESP's SPF include value and add a TXT record on your root domain.
    
2.  Generate a DKIM key in your ESP's admin panel, then publish the CNAME or TXT record they provide.
    
3.  Enable DKIM signing in the ESP's settings. This is a separate step from publishing the DNS record. Most providers require explicit activation.
    

If you send through **multiple providers** from the same domain, combine all SPF includes into a single record:

```
v=spf1 include:_spf.google.com include:spf.protection.outlook.com ~all
```

> **Error:** **Critical:** Only one SPF record per domain. Two `v=spf1` TXT records will break authentication entirely. Combine includes, never duplicate.

* * *

## How to Set Up DMARC

> **Info:** Official docs: [Set up DMARC for Google Workspace](https://support.google.com/a/answer/2466580) and [Set up DMARC for Microsoft 365](https://learn.microsoft.com/en-us/defender-office-365/email-authentication-dmarc-configure). The protocol itself is defined in [RFC 7489](https://datatracker.ietf.org/doc/html/rfc7489).

Unlike SPF and DKIM, DMARC is identical regardless of your ESP. It is a single TXT record, published once.

1.  Go to your DNS provider.
    
2.  Add a new TXT record:
    
    -   **Host / Name:** `_dmarc` (some registrars require `_dmarc.yourdomain.com`)
        
    -   **Type:** TXT
        
    -   **Value:** `v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com;`
        
3.  Save and wait for propagation (15 to 60 minutes typically).
    

Replace `dmarc@yourdomain.com` with an inbox where you actually want to receive aggregate reports. If you don't want reports, drop the `rua` parameter:

```
v=DMARC1; p=none;
```

That's it. There is no provider-specific step. DMARC is a policy declaration, not a signing mechanism.

> **Info:** **Tip:** Free DMARC report parsers like [dmarcian](https://dmarcian.com/) or [Postmark's DMARC Digests](https://dmarc.postmarkapp.com/) turn the raw XML reports into a readable dashboard. Recommended once you start collecting `rua` data.

* * *

### DMARC Policy Recommendation

The `p=` parameter controls what receivers do when an email fails SPF or DKIM:

<table style="min-width: 50px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><th colspan="1" rowspan="1"><p>Policy</p></th><th colspan="1" rowspan="1"><p>What It Does</p></th></tr><tr><td colspan="1" rowspan="1"><p><code>p=none</code></p></td><td colspan="1" rowspan="1"><p>Monitor only. Collect reports, no impact on delivery.</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>p=quarantine</code></p></td><td colspan="1" rowspan="1"><p>Failing emails go to spam.</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>p=reject</code></p></td><td colspan="1" rowspan="1"><p>Failing emails are dropped at the gateway.</p></td></tr></tbody></table>

> **Info:** **Always start with `p=none`.** Monitor reports for 2 to 4 weeks to confirm no legitimate sending source is failing authentication. Only then move to `p=quarantine`, and eventually `p=reject` for maximum protection. For cold outreach, **`p=none` is enough** to satisfy [Google and Yahoo's bulk sender requirements](https://support.google.com/mail/answer/81126). You don't need to escalate to `p=reject` to get good deliverability. What matters is that the record exists and SPF/DKIM are passing.

* * *

## DKIM Selectors: What MailBeast Looks For

DKIM records live at `<selector>._domainkey.yourdomain.com`. The selector identifies which key to use, since one domain can carry multiple DKIM keys (one per ESP).

MailBeast first checks the selector it finds in the DKIM-Signature header of your account's emails. If that is not available, it scans about 50 common selectors used by popular email providers and sending services, for example:

`default`, `mail`, `dkim`, `google`, `selector1`, `selector2`, `zoho`, `s1`, `k1`, `amazonses`

If your DKIM uses one of these, MailBeast finds and verifies it automatically. Multiple selectors on the same domain are fine. MailBeast accepts the first one it finds.

* * *

## Common Mistakes

-   **Two SPF records.** There must be exactly one TXT record starting with `v=spf1`. If you have two, delete the old one and merge all includes into one record.
    
-   **`+all` at the end of SPF.** This authorizes every server in the world to send as your domain and completely defeats SPF. Always use `~all` (softfail) or `-all` (hardfail).
    
-   **Exceeding the 10 DNS lookup limit.** Each `include:` chains into more lookups. If the total exceeds 10, the SPF record fails with `permerror`. See [Microsoft's troubleshooting notes](https://learn.microsoft.com/en-us/defender-office-365/email-authentication-spf-configure#troubleshooting-spf-txt-records) for the gory detail and [Kitterman's free SPF checker](https://www.kitterman.com/spf/validate.html) to count yours.
    
-   **Forgetting to enable DKIM in the ESP.** Adding the DNS record is half the work. Google requires **Start Authentication**, Microsoft requires the **Enable** toggle. Without that step, your mail is not signed.
    
-   **DMARC before SPF and DKIM.** DMARC enforces policy on top of SPF/DKIM. If neither is configured, DMARC has nothing to enforce. Set up SPF and DKIM first.
    
-   **Jumping to `p=reject`.** Without monitoring `p=none` reports first, a strict policy will silently block legitimate mail from forgotten sending sources (transactional services, forwarders, third-party tools).
    
-   **Cloudflare proxy on DKIM CNAME.** Set the DKIM CNAME to **DNS Only** (grey cloud). Orange-cloud proxying intercepts the lookup and breaks verification. See [Cloudflare's DNS record proxy docs](https://developers.cloudflare.com/dns/proxy-status/).
    
-   **Wrong host for DMARC.** The record goes on `_dmarc` (with underscore), not `dmarc`. Most registrars auto-append the domain.
    
-   **Multiple DMARC records.** Like SPF, only one DMARC record per domain.
    

* * *

## Verifying in MailBeast

After publishing all three records:

1.  Open the email account in MailBeast.
    
2.  Go to the **Overview** tab in the account detail sheet.
    
3.  MailBeast verifies SPF, DKIM, and DMARC automatically, both at connection time and on a regular schedule.
    
4.  Each record shows a green **Verified** badge once the lookup succeeds.
    

DNS changes typically propagate in 15 to 60 minutes, but in rare cases can take up to 48 hours. If a record stays unverified, double-check the host name and value against your ESP's instructions. External validators are useful for a quick sanity check:

-   [MXToolbox SuperTool](https://mxtoolbox.com/SuperTool.aspx) - SPF, DKIM, DMARC, MX in one place
    
-   [Google Admin Toolbox - Check MX](https://toolbox.googleapps.com/apps/checkmx/) - Google's own validator
    

### What the SPF check covers

MailBeast verifies that your domain has exactly one SPF record and that its syntax is valid. It does not test which servers or IP addresses the record lists - receiving mail servers check that against the actual sending server when your email arrives. Two SPF records, an empty record, or invalid syntax all show as an error.

* * *

## Next Steps

-   [Understanding Your DNS Health Score](https://docs.mailbeast.ai/en/articles/31.md) - see how SPF, DKIM, and DMARC contribute to your account's health score.
    
-   [Cloudflare DNS Setup](https://docs.mailbeast.ai/en/articles/29.md) - if your DNS is on Cloudflare, the orange-cloud / grey-cloud distinction matters for DKIM and tracking domain CNAMEs. For other registrars (GoDaddy, Namecheap, Squarespace, cPanel, Route 53, etc.) the actual values you publish are identical - use your registrar's own DNS docs to find the "Add TXT/CNAME record" UI, then paste the values from the relevant section above.
    
-   [Custom Tracking Domain Setup](https://docs.mailbeast.ai/en/articles/30.md) - improve deliverability further with a branded tracking domain.
