← All posts

How to add a DMARC record in Cloudflare

DMARCCloudflareHow-to

DMARC is a single TXT record at _dmarc.yourdomain.com. It tells receivers what to do when SPF and DKIM fail alignment, and where to send reports.

Before you start

  • SPF and DKIM should already work for every service that sends as your domain. See SPF, DKIM and DMARC explained.
  • Create or choose a mailbox for reports, such as dmarc@example.com. Reports are XML files and can be numerous, so use a dedicated address or a reporting service.
  • Check for an existing record: dig +short TXT _dmarc.example.com. A domain can have only one.

Add the record

  1. In Cloudflare, select your domain and go to DNS then Records.

  2. Click Add record.

  3. Type: TXT.

  4. Name: _dmarc.

  5. Content:

    v=DMARC1; p=none; rua=mailto:dmarc@example.com
  6. TTL: Auto. Save.

What the tags mean

Tag Meaning
v Version, always DMARC1, and must come first
p Policy: none, quarantine or reject
rua Where aggregate reports go
pct Percentage of mail the policy applies to (optional)
sp Policy for subdomains (optional)

Roll out gradually

  1. Start with p=none and collect reports for two to four weeks.
  2. Fix any legitimate sender that fails SPF or DKIM alignment.
  3. Move to p=quarantine, optionally with pct=25, then raise it.
  4. Finally switch to p=reject.

Verify

dig +short TXT _dmarc.example.com

You should see your record. Send a test message and check for dmarc=pass in the headers (how to read them).

Common mistakes

  • Putting the full domain in Name instead of _dmarc.
  • Misspelling v=DMARC1 or putting another tag first. The record is then ignored.
  • Reporting to an address in another domain without the authorisation record that domain must publish.
  • Jumping straight to p=reject and blocking your own newsletters.