How to Add DMARC, SPF & DKIM in Cloudflare
DNS hosting, CDN and security.
How to fill in the host field
In the Name field, use @ for the root of your domain, _dmarc for DMARC and <selector>._domainkey for DKIM.
SPF, DKIM and DMARC records
Your domain must have exactly one SPF record. Do not create a second TXT record starting with v=spf1.
Generate SPF recordIf the DKIM record is a CNAME, keep it DNS only. CNAME flattening can prevent email providers from reading the record.
Check DKIMCloudflare DMARC Management (Email > DMARC Management) can add a DMARC record for you.
Generate DMARC recordHow to create a TXT record
- 1In the Cloudflare dashboard, select your domain and go to DNS > Records
- 2Select Add record and choose TXT as the Type
- 3Fill in Name and Content
- 4TXT records are always DNS only, so there is no proxy option to change
- 5Select Save
How to create a CNAME record
- 1In the Cloudflare dashboard, select your domain and go to DNS > Records
- 2Select Add record and choose CNAME as the Type
- 3Fill in Name and Target with the values from your email service
- 4Set Proxy status to DNS only. Cloudflare says records used for email should be DNS only
- 5Select Save
Frequently Asked Questions
Why does Cloudflare split my long TXT record?
Each string in a TXT record can have at most 255 characters, so longer values are split into several strings. For SPF, DKIM and DMARC, the receiving server joins the strings back together, so the record still works.
How long do Cloudflare DNS changes take?
Changes to your Cloudflare zone take effect globally within 5 minutes, usually much less.
What does Cloudflare DMARC Management change in my DMARC record?
If you already have a DMARC record, Cloudflare adds another rua address that uses a Cloudflare email address. If you have none, it invites you to add one. It only works with apex domains.
Which values does your email service need? Browse the sending services directory
Official Cloudflare DocumentationMonitor your email authentication
Check that the records you added in Cloudflare work and get alerts when issues arise.
Monitor 1 Domain Free - No Credit Card