Sender setup
Adding SPF, DKIM and DMARC records in Cloudflare DNS
If your domain uses Cloudflare for DNS, every email authentication record is added on the DNS Records page of your dashboard. SPF and DMARC are TXT records. DKIM is either a TXT record or a CNAME record, depending on what your email provider tells you to publish. The one setting that catches people out is the proxy status on a CNAME.
By Kyle Deligny, Titanos, Brisbane. Last reviewed 1 December 2026. General information, not legal advice.
This page covers the Cloudflare side only: which type to pick, what proxy status means for email, how long a change takes to show, and how to check the result from outside your own network. Your email provider supplies the exact names and values, so copy those rather than retyping them.
Which record type goes where
Cloudflare's DNS records documentation lists the record type as the first choice when you select Add record, and the remaining fields change with that choice. Your provider's instructions will say TXT or CNAME for each entry, so match that word exactly.
An SPF record is one TXT record at the root of your domain. A DMARC record is one TXT record at the name _dmarc. A DKIM record lives at a name of the form selector._domainkey, where the selector is a label chosen by your sending service. RFC 6376 defines that layout, and RFC 7489 defines the _dmarc name.
| Purpose | Type | Name you enter |
|---|---|---|
| SPF | TXT | The root of your domain, shown as @ or the domain itself in the panel |
| DKIM | TXT or CNAME, as your provider states | selector._domainkey, using the selector from your provider |
| DMARC | TXT | _dmarc |
Proxy status and why it matters for CNAMEs
Cloudflare's proxy status documentation says only A, AAAA and CNAME records can be proxied, and that other types such as MX and TXT are always DNS only. That means your SPF and DMARC TXT records are never affected by the orange cloud.
A DKIM CNAME is different. The same documentation explains that a proxied record makes Cloudflare answer with its own addresses instead of the real target. A mail server looking up your DKIM key needs the genuine target of the CNAME, so set the record to DNS only. If your provider's screen shows a CNAME pointing at a signing key, a grey cloud is the safe choice.
Proxied records also use a fixed Auto TTL of 300 seconds, according to Cloudflare. DNS only records let you choose the TTL, which is useful while you are testing and may need a quick correction.
Name and value fields
Cloudflare's page on creating records does not spell out how the Name field treats your domain, so test rather than assume. A common pattern in dashboards is that you type the label only, and the panel shows the full name once the record is saved. If the saved row shows your domain twice, delete it and enter only the label.
For TXT values, paste the string your provider gave you as one block. DNS stores TXT data as character strings of up to 255 characters each, as set out in RFC 1035, and RFC 7208 says a record split into several strings is joined without spaces. A long DKIM key can therefore appear in pieces. Do not add extra spaces or line breaks yourself. If you are unsure whether your panel wants surrounding quotation marks, paste a short test value first and see how the saved record displays it.
Waiting and checking
Cloudflare's TTL setting controls how long a record stays valid in resolvers, and so how long a change takes to reach other networks. Because Cloudflare serves the zone itself, a new record is usually visible quickly, but resolvers that cached an older answer can take longer to catch up.
To confirm, query the record from a public resolver rather than your own machine, using a lookup tool or the command line. Our SPF builder and DMARC generator help you write the values, and the email spoofing check shows what a receiver sees.
Mistakes seen in Cloudflare zones
Two SPF TXT records on the same name is the classic fault, and it makes SPF fail outright. Merge them into one. See our page on multiple SPF records. Another is leaving an old DKIM record from a retired sender in place. It does no harm to mail, but it clutters the zone, so remove it once you are sure the sender is gone.
A third is changing DNS in Cloudflare when the domain's nameservers still point somewhere else. In that case the records in your Cloudflare dashboard are not the ones the world sees. Check the nameservers at your registrar first.
Add email records in Cloudflare
- Confirm at your registrar that the domain's nameservers are Cloudflare's.
- Open the DNS Records page for the domain and select Add record.
- Read the record type, name and value from your email provider's instructions.
- Choose TXT or CNAME to match, and enter the name label only.
- Paste the value as a single block without added spaces.
- Set any DKIM CNAME to DNS only, not proxied.
- Keep exactly one SPF TXT record at the root of the domain.
- Add DMARC at _dmarc with p=none and a reporting address to start.
- Save, then query the record from a public resolver.
- Send a test message and read the authentication results in its headers.
Questions people ask
Can I proxy a DKIM CNAME in Cloudflare?
No, keep it DNS only. Cloudflare says proxied records answer with its own addresses, and a mail server needs the real CNAME target to find your signing key.
Does the orange cloud affect my SPF or DMARC records?
No. Cloudflare states that TXT records are always DNS only, so only A, AAAA and CNAME records ever show a proxy setting.
Do I need quotation marks around a TXT value?
It depends on what the panel does with your input, and Cloudflare's guide does not cover it. Paste the value as given, save it, and check how the saved record displays.
How long until a new record works?
Often within minutes, because Cloudflare serves the zone. Resolvers that cached an older answer keep it until the TTL runs out, so allow some time before you call it broken.
Where to from here
The free privacy policy audit reads your published privacy policy against the Australian Privacy Principles and tells you what is missing. Privacy Care keeps your policy and your shopper data practices current for AU$149 a month, with a 3-month minimum. Would it be okay if we showed you what the audit finds? A no is welcome.
Sources
- Cloudflare, proxy status
- Cloudflare, create DNS records
- Australian Cyber Security Centre, email hardening
- RFC 6376, DKIM signatures
- RFC 1035, domain names implementation and specification
General information, not legal advice. Laws and guidance change: check the linked primary sources and ask a qualified adviser about your own situation. Written by Kyle Deligny with AI assistance, last reviewed 1 December 2026. How we write and check: editorial policy.
