Add DNS records at Cloudflare (SPF, DKIM, DMARC)

Short answer: if your domain’s name servers end in ns.cloudflare.com, you edit its DNS records in the Cloudflare dashboard, on the page called DNS Records (labeled Records), as of November 2026. Choose Add record, pick TXT, type the host in Name (@ for the root domain), paste the value your mail service gave you, and select Save. To change your SPF record, edit the one you have; do not add a second.

Reviewed

This page is for store owners whose domain uses Cloudflare for DNS and whose email service has asked for SPF, DKIM or DMARC records. It follows Cloudflare’s own documentation, read on 2026-11-19 (links at the end). Screens change, so if what you see differs, trust Cloudflare’s pages over ours. All examples use example.com. The real values come from your mail service, never from this page. This is an independent guide. The overview for all DNS providers is on the DNS provider hub page.

Symptom

You see one of these:

  • Your mail service or a checker asks for a TXT record and you do not know where to put it.
  • A checker says your SPF, DKIM or DMARC record is missing, and you think it is already added.
  • You are not sure whether to add a new SPF record or change the one you have.

Why it happens

DNS is the public address book of your domain. Records for email live at whichever company runs your domain’s name servers (the servers that answer for your domain). That may not be the company where you bought the domain, or your web host. If your name servers end in ns.cloudflare.com, Cloudflare answers for your domain, and a record you add anywhere else is never seen. Nothing about this is edited in WordPress.

Cloudflare’s documentation says if a hosting partner added your domain to Cloudflare for you, you manage DNS through that partner instead. If you cannot find the domain in a Cloudflare account, ask your host.

Fix

  1. Open the DNS screen. Log in to the Cloudflare dashboard, open your domain, and go to the DNS Records page (it is labeled Records). Cloudflare’s page names these two labels; it does not describe the menu above them, so look for them on your screen.
  2. Look at what is already there. Search the list for existing TXT records before you add anything. You are looking for one that starts with v=spf1. If you see one, go to step 4.
  3. Add a TXT record. Select Add record, then choose TXT as the type. Fill in:
    • Name: for the root domain, type @. Cloudflare’s page on root domain records says @ is what you enter there. For a subdomain, type only the label, for example blog, not blog.example.com.
    • Content: paste the value from your mail service, exactly. Cloudflare’s reference says TXT content is text in double quotes, and that for new records, if you save without quotes, Cloudflare adds them. So for a new record you can leave the quotes off. If you type quotes, use them at both ends, because uneven quotes give an error.
    • TTL: leave the value Cloudflare offers unless your mail service tells you otherwise. TTL is how long other servers may keep a copy of the record.
    • Comment (optional): a note for yourself, such as “SPF for store email”.

Select Save.

  1. Change your SPF record instead of adding a second one. A domain should have only one SPF record (the record that lists who may send mail for you). A second one makes SPF fail. In the list, find the TXT record that starts with v=spf1 and select Edit. Add the include: your mail service gives you before the ~all or -all at the end, then select Save. For example, v=spf1 include:_spf.example.net ~all becomes v=spf1 include:_spf.example.net include:mail.example.org ~all. Both include: names here are made up. See How to add or fix an SPF record for the rules.
  2. Add the DKIM record. Your mail service shows the type (TXT or CNAME), the host and the value. Add it as it shows, the same way as in step 3. The host usually has the form selector._domainkey, where the selector is a name your service picks, for example selector1._domainkey on example.com. Copy the host from your mail service. After you save, compare the full name in the record list: if you see ...example.com.example.com, the domain was typed twice, so edit the record and remove the extra part. See How to set up DKIM.
  3. If the DKIM record is a CNAME, set Proxy status to DNS only. A CNAME record points one name to another name. Cloudflare says only A, AAAA and CNAME records can be proxied (sent through Cloudflare’s network), that TXT records are always DNS only, and that DNS only is recommended for records that do not serve web traffic, such as email records. For a mail record, pick DNS only (the gray cloud).
  4. Add the DMARC record when SPF and DKIM pass. A DMARC record is a TXT record at the host _dmarc, with a value such as v=DMARC1; p=none; rua=mailto:dmarc@example.com. The address is an example. Add it as in step 3, with _dmarc in Name, then compare the full name in the list. See DMARC for beginners.
  5. Wait, then check. We could not confirm from Cloudflare’s pages how long a change takes to spread. Wait a short while, then follow the next section.

Check it worked

  1. In the DNS Records list, look at the Name column. A record you added for _dmarc should read _dmarc.example.com (your own domain), not _dmarc.example.com.example.com.
  2. Run the free checker on the domain your store sends from. SPF should show one valid record. The DKIM line may say “Not checked”, because the checker only tries common selector names. See the DKIM guide.
  3. Send a real order email to a mailbox at a large provider. Open “show original” and look for spf=pass and dkim=pass, and dmarc=pass if you added DMARC.
  4. If it still lands in spam, see WooCommerce emails not sending or going to spam.

What we could not confirm from Cloudflare’s pages: how it treats a TXT value longer than 255 characters (some DKIM keys are that long; check your mail service’s instructions and Cloudflare’s documentation if you hit an error), and whether it adds your domain after a host name such as _dmarc. That is why step 5 and step 7 tell you to compare the full name in the list.

How the plugin helps

Email Health Check & Log for WooCommerce reads the name servers of the domain your store sends mail from, and in its “How to fix this” panel it shows “DNS hosted at:” followed by the provider’s name when it recognizes them. For Cloudflare it looks for a name server ending in ns.cloudflare.com. It then shows a short note (your records are edited in your Cloudflare dashboard, under the DNS section for your domain, not in WordPress) and a link to Cloudflare’s page on adding DNS records, the one listed at the end of this guide. If your name servers do not match any provider it knows, for example because a different DNS service sits in front, it shows nothing for DNS, so check your name servers yourself. The detection sends none of your data to us or to Cloudflare: it is an ordinary DNS lookup of your domain’s name servers. The plugin changes no DNS records. The line appears in a check’s “How to fix this” panel, and it reads “Hosting and DNS:” instead when your web host is detected with high confidence as the same company as your DNS. Get the plugin on WordPress.org.

Sources

Cloudflare and other product names belong to their owners. They are used here only to say what a company’s documentation says. This page is not affiliated with or endorsed by any of them.

Check your own domain

Type your domain into the free checker to see whether your SPF, DKIM and DMARC records are in place. Or install the free plugin, which checks the basics from inside your dashboard.