Email Authentication
SPF, DKIM and DMARC Record Syntax
Every tag and mechanism, with copy-paste examples and the RFC that defines each one.
10
max DNS lookups allowed in one SPF record
3
DNS records that authenticate your domain
2
tags are all a valid DMARC record requires
Ozlem Yildirimerby Ozlem Yildirimer · Last updated: 2026-09-25

SPF, DKIM and DMARC Record Syntax: Every Tag With Examples

SPF, DKIM and DMARC are three DNS TXT records. SPF sits at your domain root, starts with v=spf1, lists allowed senders, and ends with an all qualifier like ~all or -all. DKIM lives at selector._domainkey and carries a public key. DMARC lives at _dmarc and needs only v=DMARC1 plus a p= policy.

Each record has its own tag vocabulary, and a single wrong character, a stray space, a second SPF record, an extra lookup, can silently break authentication. Below is every tag and mechanism for all three records, with the exact syntax, allowed values, a copy-paste example, and the RFC that defines it.

New here? Start with our primer on Email Deliverability & Authentication for the fundamentals, then come back to this guide.

Quick context: Mailsoftly offers transparent pricing, free hands-on migration, and human support. 500 contacts and 2,000 emails per month, no credit card.
Start free with Mailsoftly →

Key Takeaways

  • SPF is one TXT record starting with v=spf1 and ending in an all qualifier, capped at 10 DNS lookups (RFC 7208).
  • DKIM publishes a public key at selector._domainkey.yourdomain.com; the p= tag holds the key itself (RFC 6376).
  • DMARC requires only v=DMARC1 and p=; the policy choices are none, quarantine, and reject (RFC 7489).
  • The most common breakages are two SPF records on one domain, more than 10 lookups, and a missing v= version tag.

What is the correct SPF record syntax?

An SPF record is a single DNS TXT record at your domain root that begins with v=spf1, lists the servers allowed to send on your behalf using mechanisms like include:, ip4:, ip6:, a and mx, and finishes with an all mechanism carrying a qualifier. The record must resolve within 10 DNS lookups or receivers return a permerror.

Each mechanism can take a qualifier prefix: + pass (the default), - fail, ~ softfail, and ? neutral. In practice the only one most senders write explicitly is the qualifier on the final all: use -all to hard-fail unlisted sources or ~all to soft-fail them while you monitor. Here is every SPF mechanism and modifier defined in RFC 7208.

Mechanism / tagMeaningAllowed valuesExampleSource
v=spf1Version tag. Must be the first token.Exactly spf1v=spf1 ...RFC 7208
ip4:Authorizes an IPv4 address or range.Address or CIDRip4:198.51.100.0/24RFC 7208
ip6:Authorizes an IPv6 address or range.Address or CIDRip6:2001:db8::/32RFC 7208
aAuthorizes the A/AAAA record hosts of a domain.Optional domain and prefixa:mail.example.comRFC 7208
mxAuthorizes the domain’s MX hosts.Optional domain and prefixmxRFC 7208
include:Imports another domain’s SPF policy (each counts toward the 10-lookup limit).A domaininclude:_spf.google.comRFC 7208
allMatches everything; always last, with a qualifier.+ - ~ ?-allRFC 7208
redirect=Modifier. Replaces the record with another domain’s policy.A domainredirect=_spf.example.comRFC 7208
exp=Modifier. Points to an explanation string for failures.A domainexp=explain.example.comRFC 7208

Here is a complete SPF record example for a domain that sends through Google Workspace and one additional IP block:

Name:  example.com
Type:  TXT
Value: v=spf1 include:_spf.google.com ip4:198.51.100.0/24 ~all

For provider-specific include: values, use the string your mailbox host documents: Google Workspace publishes _spf.google.com, and Microsoft 365 publishes spf.protection.outlook.com on their own setup pages. You can validate the finished record against the 10-lookup ceiling with our SPF, DKIM and DMARC checker before you publish.

Read enough? Try Mailsoftly free with 500 contacts and 2,000 emails per month, no credit card.Start free with Mailsoftly →

What does a DKIM record look like?

A DKIM record is a TXT record published at selector._domainkey.yourdomain.com, where the selector is a label your sending platform assigns. The record value starts with v=DKIM1 and carries your public key in the p= tag. Receivers use that key to verify the cryptographic signature your outbound mail server adds to each message header.

Only v= and p= are commonly used, but RFC 6376 defines several optional tags that tune how receivers treat the key. The table below lists each one. The selector matters as much as the value: if your platform signs with selector ms1, the record must live at ms1._domainkey.yourdomain.com exactly.

TagMeaningAllowed valuesExampleSource
v=Version. Optional, but if present must be first.DKIM1v=DKIM1RFC 6376
k=Key type.rsa, ed25519k=rsaRFC 6376
p=The public key (base64). An empty p= revokes the key.Base64 stringp=MIGfMA0GCSq...RFC 6376
t=Flags. y means testing mode; s enforces exact domain match.y, st=sRFC 6376
s=Service type this key is valid for.* or emails=emailRFC 6376
h=Acceptable hash algorithms.sha256, sha1h=sha256RFC 6376
n=Human-readable notes for admins.Free textn=rotated 2026RFC 6376

Here is a DKIM TXT record example, truncated for readability. The real p= value is a long base64 string your provider generates for you:

Name:  ms1._domainkey.example.com
Type:  TXT
Value: v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC7...IDAQAB

Because most DNS hosts cap a single TXT string at 255 characters, a 2048-bit key is often split into quoted chunks that the resolver concatenates. Paste the full key your platform gives you without adding spaces or line breaks inside the base64, or verification fails even though the record “looks” present.

What is the DMARC record syntax, tag by tag?

A DMARC record is a TXT record at _dmarc.yourdomain.com that must begin with v=DMARC1 and include a policy tag p=. Everything else is optional. The policy tells receivers what to do with mail that fails both SPF and DKIM alignment, and the reporting tags tell them where to send the data you use to tune it.

Below is every DMARC tag defined in RFC 7489. One note on pct=: the IETF’s DMARCbis work, the successor to RFC 7489, deprecates the pct tag. Until DMARCbis is finalized, major receivers still honor pct=, but treat it as a transitional tag and avoid building long-term policy around partial percentages.

TagMeaningAllowed valuesExampleSource
v=Version. Required, must be first.DMARC1v=DMARC1RFC 7489
p=Policy for the domain. Required.none, quarantine, rejectp=noneRFC 7489
sp=Policy for subdomains.none, quarantine, rejectsp=rejectRFC 7489
rua=Address for aggregate (daily) reports.mailto: URI listrua=mailto:[email protected]RFC 7489
ruf=Address for forensic (per-failure) reports.mailto: URI listruf=mailto:[email protected]RFC 7489
adkim=DKIM alignment mode.r relaxed, s strictadkim=sRFC 7489
aspf=SPF alignment mode.r relaxed, s strictaspf=sRFC 7489
pct=Percent of mail the policy applies to. Deprecated in DMARCbis.0 to 100pct=100RFC 7489
fo=Forensic reporting options.0, 1, d, sfo=1RFC 7489
rf=Forensic report format.afrfrf=afrfRFC 7489
ri=Aggregate report interval in seconds.Integer (default 86400)ri=86400RFC 7489

Here is a DMARC record example that starts in monitor mode and collects reports, the safe way to begin:

Name:  _dmarc.example.com
Type:  TXT
Value: v=DMARC1; p=none; rua=mailto:[email protected]; adkim=s; aspf=s

For the broader picture on this topic, see our complete Email Deliverability & Authentication guide, which covers strategy, fundamentals, and advanced playbooks.

Which DMARC policy should you use: none, quarantine, or reject?

Start at p=none to observe without affecting delivery, move to p=quarantine to divert failing mail to spam once your reports are clean, and finish at p=reject to block spoofed mail outright. The policy is only enforced on messages that fail both SPF and DKIM alignment, so tighten alignment first and escalate the policy second.

PolicyWhat receivers doUse it when
p=noneDeliver as normal, send you reports only.You are measuring who sends as your domain. Monitoring stage.
p=quarantineRoute failing mail to the spam or junk folder.Reports are clean and you want a safety margin before full enforcement.
p=rejectRefuse failing mail at the gateway; it never arrives.All legitimate streams pass alignment. This is the enforcement goal.

Bulk senders are now pushed toward enforcement: large mailbox providers expect a published DMARC policy for high-volume domains, which is one reason moving past p=none matters. Our breakdown of how Mailsoftly handles authentication and sending walks through aligning SPF and DKIM so you can escalate your DMARC policy without stranding real mail.

Last checked: 2026-10-18. SPF values verified against RFC 7208, DKIM against RFC 6376, and DMARC against RFC 7489, with the DMARCbis pct deprecation noted above.

What are the most common SPF, DKIM and DMARC syntax errors?

The three breakages that account for most authentication failures are a second SPF record on the same domain, more than 10 DNS lookups in SPF, and a missing version tag. All three produce silent failures: the record exists, but receivers treat it as invalid.

If you would rather have these generated and validated for you instead of hand-editing DNS, Mailsoftly’s domain setup walks you through publishing all three records with the correct selectors and includes, then confirms each one resolves before you send.

Frequently Asked Questions

Can a domain have more than one SPF record?

No. A domain may publish exactly one SPF (v=spf1) TXT record. If two exist, receivers return a permanent error and skip SPF entirely. Combine every authorized sender, including both your mailbox host and any marketing platform, into a single record using multiple include: and ip4: mechanisms.

What does v=DMARC1 p=none mean?

v=DMARC1; p=none is a monitoring-only DMARC policy. It asks receivers to take no action against mail that fails authentication while still sending you aggregate reports through the rua= address. It is the recommended starting point so you can see every source sending as your domain before you enforce quarantine or reject.

Where does the DKIM record go in DNS?

A DKIM record is a TXT record at selector._domainkey.yourdomain.com, where the selector is the label your sending platform assigns (for example ms1._domainkey.example.com). It is not published at the domain root. The selector in DNS must match the selector your server uses to sign outbound mail, or verification fails.

How many DNS lookups can an SPF record use?

SPF allows a maximum of 10 DNS lookups during evaluation, as defined in RFC 7208. Each include:, a, mx, ptr, exists and redirect mechanism counts toward that limit. Exceeding 10 returns a permerror and SPF is treated as failed, so keep includes lean.

Do I need all three records to reach the inbox?

Effectively, yes. SPF and DKIM prove a message is authorized and unaltered, and DMARC tells receivers how to handle failures and reports back to you. Major mailbox providers expect authenticated mail from any serious or bulk sender, so publishing all three is the baseline for consistent inbox placement.

Ready to switch?Start free with Mailsoftly →
500 contacts, 2,000 emails per month. Free hands-on migration. No credit card.

Ozlem Yildirimer
Ozlem Yildirimer
Deliverability & Automation Specialist at Mailsoftly
Ozlem is a Deliverability & Automation Specialist at Mailsoftly who helps senders land in the inbox and turn one-off broadcasts into automated journeys. She writes about authentication, sender reputation, and building workflows that run without constant babysitting.