DKIM
DKIM failing after publishing the record in Cloudflare? Fix proxied (orange cloud) records, CNAME flattening, and selector hostname mistakes so DKIM verifies.
Updated Jul 1, 2026
The short answer
"Cloudflare DKIM not working" isn't an SMTP error — it means a DKIM record published in Cloudflare DNS isn't resolving the way the receiving mail server expects, so DKIM verification fails. The usual causes are Cloudflare proxying the record (orange cloud), the optional "flatten all CNAME records" setting rewriting a DKIM CNAME, or a wrong selector hostname. Fix it by setting the record to DNS only, turning off CNAME flattening for that record, and publishing the exact selector host your provider gave you.
"Cloudflare DKIM not working" is not an SMTP reply code or a DKIM protocol error — it's a configuration symptom. Your provider (SES, SendGrid, Mailgun, Postmark, Mailchimp, Courier, etc.) reports DKIM as unverified or failing even though you added the record in Cloudflare. The DKIM record itself is fine; Cloudflare is changing what the public DNS query actually returns.
DKIM verification works by the receiving server doing a DNS TXT lookup at <selector>._domainkey.<domain> (RFC 6376 §3.6.2.1 defines the selector namespace; §3.6.2.2 specifies that the lookup defaults to a TXT record) and reading the public key from it. Many providers ask you to publish that key as a CNAME that points to a record they host. Three Cloudflare behaviors commonly break this:
<selector>._domainkey.<domain>), that default does not touch DKIM. The failure mode only shows up if you've also turned on Cloudflare's optional "flatten all CNAME records" setting, which applies flattening to every CNAME including your DKIM selector. Because ESP-hosted DKIM CNAME targets (e.g. Mailchimp's dkim.mcsv.net) typically hold only a TXT record and no A/AAAA record, flattening that selector either returns NODATA (per Cloudflare's docs) or, per real-world reports, surfaces the underlying TXT content instead of the CNAME hostname the verifier expects. Either way, DKIM validation fails — Mailchimp users have documented this exact failure.s1._domainkey.example.com, Cloudflare stores s1._domainkey.example.com.example.com. Enter only the host portion (s1._domainkey) and let Cloudflare append the domain.TXT, Name = the host your provider gave you (e.g. s1._domainkey), Content = the full v=DKIM1; k=rsa; p=... value. Do not repeat the domain — Cloudflare appends it.dig +short TXT s1._domainkey.example.com# or for a CNAME-style record:dig +short CNAME s1._domainkey.example.com
A CNAME query should return the provider's target hostname (not an IP). A TXT query should return the v=DKIM1... key.
dig shows the correct value, re-run verification in your sending provider's dashboard.If dig returns the correct record but the provider still fails, the problem is no longer Cloudflare — check the selector name matches the one your provider is signing with, and that the key wasn't truncated.
References
FAQ
DNS only (grey cloud). Cloudflare's proxy (orange cloud) is for HTTP/HTTPS traffic and prevents DKIM CNAME/TXT records from resolving the way verifiers expect. Postmark and other providers explicitly require turning the proxy off before verification.
One API, every provider
Courier connects to your email, SMS, and push providers, handles retries and failover, and surfaces delivery errors in plain language.
Reply-code definitions per RFC 6376 §3.6.2.1 & §3.6.2.2. Last reviewed Jul 1, 2026. Courier is not affiliated with third-party providers; error behavior may vary by implementation.
© 2026 Courier. All rights reserved.