← Back to Blog
What mean SPF in domain record validations
2026-11-30 10:29 · 24ed87cb
security
SPF stands for Sender Policy Framework. It's a DNS-based mechanism used in email authentication.
SPF is an TXT record in your domain's DNS that tells receiving mail servers which servers/IPs are authorized to send email on behalf of your domain.
``
So in short: SPF is a simple "whitelist of IPs" in DNS that helps mail servers verify an email wasn't forged.
What it does
SPF is an TXT record in your domain's DNS that tells receiving mail servers which servers/IPs are authorized to send email on behalf of your domain.
Example
``
v=spf1 include:_spf.google.com ~all
`
| Token | Meaning |
|-------|---------|
| v=spf1 | Version indicator (must be the first token) |
| include:_spf.google.com | Allow Google's mail servers (e.g., for Gmail) |
| ~all | Soft-fail: unknown senders get a warning (not a hard reject) |
Common
v=spf1 qualifiers
- include:<domain> – delegate to another domain's SPF list
- a:ip / mx:domain – allow a specific IP / mail exchanger
- +all – hard pass (authorized)
- -all – hard fail (reject)
- ~all – soft fail (warn)
- ?all – neutral (no opinion)
How it's used in validation
1. When an incoming email claims From: user@example.com, the receiving MTA queries the SPF TXT record for example.com.
2. It checks whether the sending server's IP is in the allowed list.
3. The result is published in the email's Authentication-Results or DKIM/SPF header (e.g., spf=pass, spf=fail, spf=softfail).
4. This helps prevent email spoofing – an attacker can't forge a From address for a domain unless their IP is listed in that domain's SPF record.
Quick gotchas
- Only 10 DNS lookups are allowed in the SPF chain (includes + a/mx lookups combined). Exceeding it → the record is treated as fail.
- SPF is not a replacement for DKIM (cryptographic signature) or DMARC (policy enforcement). Many organizations use all three together.
- If a domain has no SPF record at all, receivers may treat it as a fail` or apply a conservative default, depending on their policy.So in short: SPF is a simple "whitelist of IPs" in DNS that helps mail servers verify an email wasn't forged.
Comments
0 comments