DNS TXT Records: SPF, DKIM, DMARC, and Why One Typo Breaks Everything
DNS TXT Records: SPF, DKIM, DMARC, and Why One Typo Breaks Everything
TXT records look harmless: âjust a string in DNS.â But for most domains, TXT is doing the heaviest lifting in your entire DNS zone.
- SPF uses TXT to say which servers are allowed to send mail for your domain.
- DKIM uses TXT to publish your public key so recipients can verify signatures.
- DMARC uses TXT to publish your policy and reporting addresses.
- Domain verification (Google, Microsoft, Apple, and many others) often uses TXT tokens to prove ownership.
And hereâs the part people only learn after a painful incident: one typo can silently break email deliverability or weaken anti-spoofing protections.
If you want to sanity-check what the world sees right now, start with our DNS lookup tool and search for your domainâs TXT records.
Why TXT Is So Fragile (Even for Experienced Teams)
TXT records are deceptively easy to misconfigure because:
- Theyâre just strings â thereâs no strict schema enforcement at the DNS layer.
- Providers render them differently â what looks like one record in a UI may be split into multiple strings behind the scenes.
- Whitespace and punctuation matter â semicolons, colons, quotes, and even invisible spaces can change meaning.
- Names matter as much as values â
_dmarc,selector._domainkey, and root (@) have very different semantics.
â ď¸ Warning
If you change a TXT record and email breaks, it may not fail loudly. Many systems degrade quietly: authentication fails, spam scores rise, and mail slowly stops landing in inboxes.
The TXT Record âStackâ: SPF, DKIM, DMARC, Verification
Think of TXT as a shared bulletin board. Multiple systems post messages there, and each system expects its message to be formatted exactly right.
| TXT Record Use | Where It Lives | What It Looks Like | What Breaks When Wrong |
|---|---|---|---|
| SPF | Root (example.com) |
v=spf1 ... |
Mail can fail SPF checks; spoofing protection weakens |
| DKIM | selector._domainkey.example.com |
v=DKIM1; k=rsa; p=... |
DKIM signatures canât be verified |
| DMARC | _dmarc.example.com |
v=DMARC1; p=... |
Policy/reporting donât apply; spoofing protection weakens |
| Verification | Varies (often root) | google-site-verification=... |
Service canât verify domain ownership |
If youâre newer to the DNS side of this, the DNS records guide and email security overview give the mental model.
SPF: Sender Authorization (and the âOne Characterâ Failures)
SPF is a TXT record at the root of the domain:
example.com. IN TXT "v=spf1 include:_spf.example.com -all"
SPF mistakes that look tiny but matter
1) Two SPF records at the root
A common migration failure is leaving an old SPF record in place and adding a new one. SPF evaluation expects one policy.
; â WRONG - multiple SPF records
example.com. IN TXT "v=spf1 include:_spf.oldprovider.com -all"
example.com. IN TXT "v=spf1 include:_spf.newprovider.com -all"
Your receiver may treat this as a permanent error, which can hurt deliverability.
2) A missing quote or pasted âsmart quotesâ
TXT values should be plain quotes. Some UIs (or copy/paste from rich text) introduce curly quotes.
; â
CORRECT
example.com. IN TXT "v=spf1 include:_spf.example.com -all"
3) Exceeding the SPF DNS lookup limit
SPF can trigger DNS lookups via include, a, mx, ptr, and redirect. Thereâs a hard limit of 10 lookups during evaluation. (This is why SPF tends to get messy over time.)
đĄ Pro Tip
If your SPF record has âgrown organicallyâ for years, validate it regularly and consolidate includes where possible. The fastest SPF fixes are usually deleting stale includes from old vendors.
How to check SPF quickly
- Use the SPF checker to validate syntax and spot common issues.
- For a broader view of your mail auth setup, use the Email Authentication Checker.
DKIM: Signatures + Public Keys (Selectors Matter)
DKIM publishes a public key in DNS so a recipient can verify the signature attached to the email.
The record is not at the root. Itâs at a selector under _domainkey:
selector1._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQ..."
DKIM mistakes that break verification
1) Wrong hostname (missing _domainkey or wrong selector)
If your provider tells you to publish selector1._domainkey, publishing at selector1.example.com wonât work.
2) Key pasted with whitespace or line breaks
Some DNS providers will accept it; some wonât. Many receivers will treat the record as invalid.
3) Record splitting confusion
Some DNS control panels split long TXT values into multiple quoted chunks behind the scenes. Thatâs usually okay (DNS concatenates them), but editing those chunks manually can introduce extra characters.
â ď¸ Warning
Donât âclean upâ DKIM keys by re-wrapping lines or inserting spaces. DKIM public keys are opaque stringsâany modification changes the key.
How to check DKIM quickly
- Use the DKIM checker for a selector-based lookup.
- If youâre also troubleshooting DMARC failures, read DMARC alignment explained.
DMARC: Policy, Reporting, and Alignment
DMARC is also TXT, but it lives at a fixed subdomain: _dmarc.
_dmarc.example.com. IN TXT "v=DMARC1; p=none; rua=mailto:dmarc@example.com"
That single line can:
- Tell receivers what to do with unauthenticated mail (
p=none|quarantine|reject) - Specify where to send aggregate reports (
rua=) - Control alignment strictness (
adkim=andaspf=)
DMARC mistakes that cause âfalse confidenceâ
1) Publishing DMARC at the root instead of _dmarc
This is easy to do in a rushed change window.
; â WRONG - DMARC must be at _dmarc
example.com. IN TXT "v=DMARC1; p=reject; rua=mailto:dmarc@example.com"
; â
CORRECT
_dmarc.example.com. IN TXT "v=DMARC1; p=reject; rua=mailto:dmarc@example.com"
2) Typos in tags (DMARC is picky)
rua vs r u a, missing semicolons, or v=DMARC; instead of v=DMARC1; can invalidate the record.
3) Policy set, but alignment fails
DMARC enforcement depends on SPF and/or DKIM aligning with the visible From domain. If youâre seeing âDMARC fails even though SPF passesâ, alignment is usually why.
How to check DMARC quickly
- Use the DMARC checker to validate the record.
- If youâre enforcing DMARC, consider monitoring with the DMARC Report Analyzer.
Domain Verification TXT Records (Google, Microsoft, and Friends)
Verification records are often the simplest TXT records⌠and still easy to break.
Youâll commonly see values like:
example.com. IN TXT "google-site-verification=abcdefghijklmnopqrstuvwxyz123456"
example.com. IN TXT "MS=ms12345678"
example.com. IN TXT "apple-domain-verification=abcdefghijklmnopqrstuvwxyz"
Verification pitfalls
- Placed on the wrong name: many services require the token on the root, not on
www(or vice versa). - Deleted âbecause it looks oldâ: tokens often remain required for ongoing services.
- Accidentally merged: a token should be its own TXT record; donât paste it into SPF.
đĄ Pro Tip
Keep a short âDNS ownership logâ in your team docs: which service owns which verification token, and who requested it. It prevents accidental deletions later.
A Practical âOne Typo Breaks Everythingâ Checklist
Before you hit Save in your DNS provider, run through this list.
Record name checks
- â
SPF is at the root (
example.com/@) - â
DMARC is exactly
_dmarc.example.com - â
DKIM is
selector._domainkey.example.com(selector matches your mail provider)
Record value checks
- â
SPF starts with
v=spf1and ends with~allor-all(intentionally) - â
DMARC starts with
v=DMARC1;and includes a validp=policy - â
DKIM starts with
v=DKIM1;andp=has no spaces/newlines inserted - â Verification tokens are their own records (not inside SPF/DMARC)
Change safety checks
- â Take a copy of the current record text before editing
- â Make one change at a time (especially during provider migrations)
- â Keep TTL reasonable during planned changes, then raise it again afterward
If you need to validate TTL behavior while youâre changing records, our TTL checker can help you confirm what resolvers will cache.
How to Inspect TXT Records the Same Way Receivers Do
Different DNS providers display TXT records differently, and some UIs hide important details (like the exact hostname a record is published on).
To see what receivers will see, use DNSLens to look up the exact names that matter:
- All TXT records at the root: use our DNS lookup tool and search your domain (this shows the TXT set at
example.com). - DMARC TXT record: look up
_dmarc.yourdomain.com(or run the DMARC checker). - DKIM TXT record (selector-based): look up
selector._domainkey.yourdomain.com(or use the DKIM checker and enter the selector your email provider gave you).
If the record content looks right but results still fail, the most common cause is the record being published on the wrong hostname (root vs _dmarc vs selector._domainkey).
Key Takeaways
- â TXT records power SPF, DKIM, DMARC, and domain verification
- â The smallest mistakes (wrong hostnames, punctuation, quotes, or extra spaces) can break authentication
- â
SPF, DKIM, and DMARC each live at different namesâroot vs
_dmarcvsselector._domainkey - â Verification tokens should be separate TXT records, not merged into auth records
- â Regular audits prevent âquiet failuresâ that only show up as deliverability problems later
If youâre auditing your email routing too, see MX record priorities explained.