How can TXT formatting errors break authentication?
Still have a question, spotted an error, or have a better explanation or a source we should cite?
You publish your SPF record, wait for DNS to propagate, and then run a check only to find it's failing. Authentication errors are frustrating because the symptoms show up in your deliverability, but the cause is often a single invisible character buried in a DNS record. Let's walk through the most common formatting mistakes and what they actually look like.
SPF formatting errors
SPF records have to start with v=spf1. Miss that prefix or misspell it, and the record won't be recognized at all. A few other mistakes that quietly break things:
- Typos in mechanisms. Writing
includ:instead ofinclude:orip:instead ofip4:causes the mechanism to fail silently. - Missing spaces between mechanisms.
v=spf1 include:sendgrid.net~allneeds a space before~all, not just at the start. Run the tokens together and the parser chokes. - Wrong IP format.
ip4:192.168.1is not a valid address. You need the full CIDR notation:ip4:192.168.1.0/24. - Multiple SPF records. If you publish two
v=spf1records on the same domain, receiving servers see a permanent error and treat both as invalid.
A correct, minimal SPF record looks like this:
v=spf1 include:mail.example.com ip4:203.0.113.5 ~all
DKIM formatting errors
DKIM records live at a specific selector address (something like selector1._domainkey.yourdomain.com). The most common issues:
- Wrong selector name. The selector in the DNS record has to exactly match the selector in your email header. One character off and the signature won't verify.
- Line breaks in the public key. Many DNS interfaces wrap long strings. Some parsers handle this fine. Others don't. If your key got split across lines during copy-paste, it may look correct but fail verification.
- Missing or truncated
p=value. The public key lives in thep=tag. If it's empty (p=with nothing after it), that tells receiving servers the key has been revoked and they'll reject everything signed with it.
Now a correct DKIM TXT record looks like this:
v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBA...
DMARC formatting errors
DMARC records use tag-value pairs separated by semicolons. That means the formatting rules are strict, and easy to get wrong:
- Wrong tag separator. Commas don't work here. Only semicolons separate tags, and the record has to start with
v=DMARC1;. - Invalid policy values. The
p=tag only acceptsnone,quarantine, orreject. Anything else (likep=monitor) will cause the record to fail parsing entirely. - Spaces in the wrong places.
p =nonewith a space before the equals sign is invalid. Tags and values need to connect without gaps.
So a correct minimal DMARC record looks like this:
v=DMARC1; p=none; rua=mailto:reports@yourdomain.com
The sneaky ones that catch everyone
A few error types cut across all three record types and are surprisingly common:
- Invisible characters from copy-paste. Copy a record from a Google Doc, a PDF, or a web page and you may carry over a zero-width space or a non-breaking space. The record looks right but fails every check. Always type critical records by hand or paste into a plain-text editor first.
- Smart quotes instead of straight quotes. Word processors love turning
"into“and”. DNS parsers don't. If your record was drafted in any rich-text tool, check for curly quotes before publishing. - Extra or missing quotes in the DNS interface. Some DNS providers wrap the value in quotes for you. Others expect you to add them. If you double-wrap (
""v=spf1..."") or forget them where required, the record breaks.
The safest move after publishing any of these records is to run them through a validator right away. You can check your SPF record with our free SPF checker, look up your DKIM signature with the DKIM record lookup, or parse your DMARC setup with the DMARC parser. All free, no account needed. If something's still broken after checking, our SOS hotline is there (genuinely free, no pitch).
The Email Almanac Field Notes: the most useful email questions, once a month
One email a month. New questions worth reading, real deliverability changes (Gmail and Outlook updates, etc.), and any tool or report that landed since the last issue. No fluff, no upsell.
Contributors
Who worked on this answer
Every name links to their profile. Every company links to their site. Real people, real accountability.