DNS SPF, DKIM & DMARC Explained: Fixing the RFC 7208 10-DNS-Lookup PermError Limit
Adding Google Workspace, SendGrid, Zendesk, and HubSpot to your domain's TXT record looks harmless—just four include statements. Yet mail receivers immediately reject or spam-folder your invoices with an SPF PermError because nested vendor includes quietly pushed your domain past RFC 7208's hard ceiling of 10 DNS lookups.
1. How SPF, DKIM, and DMARC Work Together
Email authentication rests on three complementary DNS layers. SPF (Sender Policy Framework, RFC 7208) publishes a TXT record listing which IP addresses are authorized to send mail using your domain in the SMTP envelope (Return-Path). DKIM (RFC 6376) attaches a cryptographic RSA or Ed25519 signature header verified against a public key stored under <selector>._domainkey.yourdomain.com, surviving mail forwarding even when IPs change.
DMARC (RFC 7489), published at _dmarc.yourdomain.com, ties both together through domain alignment: at least one of SPF or DKIM must pass AND match the visible header From: domain. DMARC also instructs receivers what to do on failure (p=none for monitoring, p=quarantine for spam folder, p=reject for hard rejection) and where to send daily XML aggregate reports.
2. The Hidden RFC 7208 Trap: Counting Nested SPF DNS Lookups
RFC 7208 Section 4.6.4 limits receiving mail servers to a maximum of 10 DNS-querying mechanisms while evaluating an SPF record to prevent DNS amplification attacks. Each include, a, mx, ptr, exists, and redirect modifier costs 1 lookup—AND every nested include inside your SaaS vendor's SPF record counts against YOUR 10-lookup budget! By contrast, ip4: and ip6: literals cost 0 DNS lookups.
For example, include:_spf.google.com alone expands into 3 nested netblocks (4 lookups total), and marketing platforms frequently consume 3–5 lookups each. Exceeding 10 lookups forces compliant receivers (Gmail, Microsoft 365) to abort evaluation with PermError.
# Audit your domain's live SPF & DMARC TXT records
dig +short TXT example.com | grep v=spf1
dig +short TXT _dmarc.example.com
# Clean, lookup-safe SPF + progressive DMARC rollout
example.com. TXT "v=spf1 include:_spf.google.com ip4:203.0.113.25 -all"
_dmarc.example.com. TXT "v=DMARC1; p=quarantine; pct=100; rua=mailto:[email protected]; adkim=r; aspf=r"
3. Safe Ways to Stay Under 10 Lookups Without Breaking Deliverability
F
i
r
s
t
,
i
s
o
l
a
t
e
t
r
a
n
s
a
c
t
i
o
n
a
l
a
n
d
m
a
r
k
e
t
i
n
g
s
e
n
d
e
r
s
o
n
t
o
d
e
d
i
c
a
t
e
d
s
u
b
d
o
m
a
i
n
s
(
f
o
r
e
x
a
m
p
l
e
,
m
a
i
l
.
e
x
a
m
p
l
e
.
c
o
m
f
o
r
S
e
n
d
G
r
i
d
a
n
d
m
a
r
k
e
t
i
n
g
.
e
x
a
m
p
l
e
.
c
o
m
f
o
r
n
e
w
s
l
e
t
t
e
r
s
)
,
g
i
v
i
n
g
e
a
c
h
s
u
b
d
o
m
a
i
n
i
t
s
o
w
n
f
r
e
s
h
1
0
-
l
o
o
k
u
p
S
P
F
b
u
d
g
e
t
a
n
d
p
r
o
t
e
c
t
i
n
g
a
p
e
x
d
o
m
a
i
n
r
e
p
u
t
a
t
i
o
n
.
S
e
c
o
n
d
,
r
e
m
o
v
e
o
b
s
o
l
e
t
e
'
a
'
,
'
m
x
'
,
a
n
d
d
e
p
r
e
c
a
t
e
d
'
p
t
r
'
m
e
c
h
a
n
i
s
m
s
i
f
y
o
u
r
w
e
b
s
e
r
v
e
r
d
o
e
s
n
o
t
o
r
i
g
i
n
a
t
e
m
a
i
l
d
i
r
e
c
t
l
y
.
T
h
i
r
d
,
a
v
o
i
d
s
t
a
t
i
c
m
a
n
u
a
l
I
P
f
l
a
t
t
e
n
i
n
g
u
n
l
e
s
s
a
u
t
o
m
a
t
e
d
,
b
e
c
a
u
s
e
c
l
o
u
d
p
r
o
v
i
d
e
r
s
r
o
t
a
t
e
o
u
t
b
o
u
n
d
I
P
r
a
n
g
e
s
w
i
t
h
o
u
t
w
a
r
n
i
n
g
.