Emailgers

Provider guide · updated 2026-09-03

Cloudflare DNS: adding mail records correctly

Cloudflare hosts DNS for many domains. Mail records must be DNS-only (grey cloud), and Cloudflare's Email Routing and DMARC Management features add their own records that interact with your SPF and DMARC.

Adding TXT, CNAME and MX records

In the Cloudflare dashboard, select the domain, open DNS, then Records, and click Add record. For SPF and DKIM choose TXT. For provider-delegated DKIM or return paths choose CNAME. For mail exchangers choose MX and set the priority.

Use @ as the name for the root domain. For a subdomain record such as _dmarc, enter only the subdomain part; Cloudflare appends the domain.

TypeNameValue
TXT@v=spf1 include:_spf.google.com ~all

Example only. Use the include for your mail provider.

TXT_dmarcv=DMARC1; p=none; rua=mailto:[email protected]

Keep mail records DNS-only

Cloudflare's proxy (orange cloud) only applies to A, AAAA and CNAME records, and it is meant for web traffic. A proxied CNAME for a DKIM selector or return path returns Cloudflare addresses instead of the provider's target, and verification fails.

Set every CNAME used for email to DNS only (grey cloud). MX and TXT records cannot be proxied, but the hostnames an MX points to must also be DNS only.

Email Routing adds MX and SPF records

Cloudflare Email Routing forwards mail for your domain to another mailbox. Enabling it installs Cloudflare MX records and an SPF TXT record containing include:_spf.mx.cloudflare.net. If you already had an SPF record, Cloudflare asks to merge; check that the result is a single record.

Email Routing is for receiving. It does not send outbound mail as your domain, so your outbound provider's SPF include and DKIM records are still required.

DMARC Management

Cloudflare DMARC Management publishes a DMARC record with a Cloudflare rua address and displays aggregate report data in the dashboard. It is a convenient way to read reports if you do not run a separate reporting tool.

It does not change your policy automatically. You still decide when to move from p=none to quarantine or reject, based on the sources it shows.

DNSSEC

Cloudflare can sign your zone with DNSSEC. Enabling it in DNS, Settings gives you a DS record to add at your registrar. DNSSEC protects DNS answers from tampering; it is not required for email authentication, but it removes a finding from the audit.

Sources