SPF, DKIM and DMARC Explained With Sample Records

What SPF, DKIM and DMARC do in one line each, with sample records, the one-SPF-record rule, starting DMARC at p=none, and how to check them.

Published 1 December 2026

SPF lists the servers allowed to send email for your domain. DKIM adds a signature that helps receivers check the message. DMARC checks that a passing result matches your From address, and says how you want failed mail handled. Set up SPF and DKIM first. Then start DMARC with p=none, which watches without asking for mail to be blocked.

Why SPF can pass when DMARC fails

Imagine a shop that uses orders@example.com in the From line. It sends offers through a newsletter company. The names here are made up:

  • SPF passes for bounce.example.net, the newsletter company's hidden return address.
  • DKIM passes, but the signature belongs to example.net.
  • DMARC fails, because neither passing result matches example.com in the From line.

DMARC needs only one match, from either SPF or DKIM. Its normal setting also accepts a match between the main domain and its subdomains. To fix this example, the shop should use the newsletter tool's domain setup so that DKIM signs as example.com. Having both match is safer, because forwarded mail often fails SPF while DKIM can still pass.

Sample records for example.com

Screenshot or export all your DNS records before you change anything. A mistake can send real invoices to spam. Open the DNS panel of the company that runs your nameservers. These samples use made-up values, so do not publish them unchanged:

SPF
Name:  @
Type:  TXT
Value: v=spf1 include:_spf.example.net ip4:192.0.2.10 ~all

DKIM
Name:  s1._domainkey
Type:  TXT
Value: v=DKIM1; k=rsa; p=PASTE_YOUR_FULL_PUBLIC_KEY

DMARC
Name:  _dmarc
Type:  TXT
Value: v=DMARC1; p=none; rua=mailto:dmarc@example.com

Replace these parts:

  • _spf.example.net: use the SPF name from your email provider. Google Workspace uses _spf.google.com.
  • 192.0.2.10: use the public IP address of another server that sends your email. If you have none, delete ip4:192.0.2.10.
  • s1: use your provider's DKIM selector, which is the label that finds the right key. Google's default is google.
  • PASTE_YOUR_FULL_PUBLIC_KEY: use the complete public key from your provider. Never put a private key in DNS. If your provider gives you a CNAME for DKIM, use that instead of this TXT sample.
  • dmarc@example.com: use a mailbox on your own domain that you can read. Reports sent to another domain can need extra setup there.

In many panels @ means the main domain, and others use a blank field. Enter the Name the way your panel expects, so it does not add your domain twice. If SPF or DMARC already exists, edit that record. Do not add another one.

In SPF, ~all means other servers are probably not allowed. -all means they are not allowed. If you use -all before you list every real sender, receivers may reject good mail.

Keep one SPF record per name

example.com can have many TXT records, but only one can start with v=spf1. With two, SPF returns an error instead of a pass. This made-up setup is wrong:

v=spf1 include:_spf.google.com ~all
v=spf1 include:mail.example.net ~all

Put both senders in one record:

v=spf1 include:_spf.google.com include:mail.example.net ~all

Use _spf.google.com only if you send through Google Workspace. Replace mail.example.net with your other sender's SPF name. Keep one v=spf1 and one ~all.

SPF allows at most 10 items that need a DNS lookup. include, a, mx, ptr, exists and redirect count, even when they are inside another include. ip4, ip6 and all do not. If you go over 10, SPF returns an error. Remove senders you no longer use, and do not use ptr in a new record.

Start DMARC without blocking your own mail

RFC 9989, published in May 2026, is the current DMARC standard and replaces RFC 7489. Follow these stages:

  1. Set up SPF and DKIM for every service that sends your email. Google says to do this at least 48 hours before DMARC.
  2. Publish the p=none sample with your own report address. It does not ask receivers to block or move failed mail. It does not stop fake mail either. rua asks receivers to send summary reports.
  3. Use a DMARC report reader, because the files are made for software. Check the mailbox, website forms, invoices and newsletter tool. Fix every real sender that fails.
  4. When all your real mail passes, consider p=quarantine, which treats failed mail as suspicious. Wait until monthly invoices have been checked too. The policy also covers your subdomains unless you add sp=, so check mail from addresses such as offers@shop.example.com. If real mail starts to fail, change the policy back to none while you fix that sender. DNS can take time to update.
  5. Move to p=reject only after another review. Your mail must have working DKIM, not just SPF. If staff post to email discussion lists, the standard advises against reject. A domain like this that still wants reject should first spend at least a month on none, then an equal time on quarantine.

Do not rely on pct= to protect real mail. Some guides, including Google's, still use it to apply a policy to only some mail. RFC 9989 removed that tag and says unknown tags must be ignored. For a receiver that follows it, p=quarantine; pct=5 covers all failed mail, not 5%. The new t=y tag asks receivers to go one level softer, but older systems may ignore it too. Leave both out, and stay on p=none until every real sender passes.

Check the records and a real email

  1. Enter your domain and DKIM selector in our DNS checker. Check that each record appears. It also warns you if there is more than one SPF record. Google says SPF and DKIM can each take up to 48 hours to work.
  2. Send an email from your business mailbox to a Gmail address you own. On a computer, open it, select More beside Reply, then Show original.
  3. Look for spf=pass, dkim=pass and dmarc=pass. If one fails, send that result to your email provider. Remove private details first.
  4. Repeat the test with a website form, an invoice and a newsletter. Each may use a different sender.

If real emails pass but still go to spam, follow the spam checks in order. If you are still choosing a mailbox, see how to set up business email.

Common questions

Do I need all three if I send only a few emails?

It is a good idea. Gmail requires SPF or DKIM from every sender, and all three from bulk senders. Google recommends always setting up all three.

What if my domain never sends email?

First make sure that no mailbox, form or invoice uses the domain or any of its subdomains. Then SPF can be v=spf1 -all, and DMARC can be v=DMARC1; p=reject. On a domain that sends real email, never use that SPF record or jump straight to reject.

Will these records put every email in the inbox?

No. They help prove which domain sent the message. Receivers also look at spam reports, sending history and content. A message can pass all three checks and still go to spam.

Sources

Read next

Check a domain name