Visual RFC.
ALL RFCs / RFC 7208
Read the RFC ↗
RFC 7208 / MECHANISM GUIDE

DNS work and errors

04

Evaluation is bounded so a policy cannot cause unlimited DNS-driven work.

RFC 7208 · § 4.6.4EXAMPLE

EXPLORE ONE SPF DECISION · FICTIONAL EXAMPLES

What stops DNS-driven SPF work from growing forever?

Step 4 of 4 — Finish or stop at the limit

Ten include terms fit the limit. In this fixture none authorizes the sender, so -all gives fail.

Receiving server

Shared DNS-term budget10 / 10
include queryTXT policy

DNS

Nested domains hop1.example … hop10.exampleReturns the next policy

Follow the nested policy chain

example.org: v=spf1 include:hop1.example -all
  1. 1include:hop1.exampleEvaluated · one slot
  2. 2include:hop2.exampleEvaluated · one slot
  3. 3include:hop3.exampleEvaluated · one slot
  4. 4include:hop4.exampleEvaluated · one slot
  5. 5include:hop5.exampleEvaluated · one slot
  6. 6include:hop6.exampleEvaluated · one slot
  7. 7include:hop7.exampleEvaluated · one slot
  8. 8include:hop8.exampleEvaluated · one slot
  9. 9include:hop9.exampleEvaluated · one slot
  10. 10include:hop10.exampleEvaluated · one slot

Each hop’s policy includes the next; the last policy is v=spf1 -all. All IPs and policies here are fictional.

For the ten-term case, the deepest -all returns fail. Each parent include then does not match, so its parent policy also reaches -all. Only an included pass would make include match.

FAILThe budget is valid; this example still fails because no mechanism authorizes the sender.
Which terms count, and what else is limited?

include, a, mx, ptr and exists, plus redirect, share the ten-term limit. ip4, ip6 and all do not count. The initial SPF TXT lookup is not one of these terms. One term can cause several DNS queries: this is not a ten-packet limit.

MX and PTR processing have additional address-query limits. Void lookups should be limited to two by default; exceeding that limit produces permerror. These extra limits are outside this chain experiment. The ptr mechanism is not recommended.

Try an alternative outcome

Changing an input shows the completed outcome. Restart restores the original example. This is a bounded teaching model, not the complete SPF evaluation algorithm.

Count evaluated DNS-causing terms across the entire recursion. A policy error is different from an unauthorized IP.

3 / 3
03
Stop an eleventh term

Exceeding the limit returns permerror instead of recursing forever.

DNS work and errorsEvaluation is bounded so a policy cannot cause unlimited DNS-driven work.DNS work and errorsDNS-causing terms evaluatedTerm 11 → permerror

Key idea: The total number of DNS-causing terms evaluated is limited to 10.

Terms

Look up a term in the glossary ↗

Rules & examples
  • The total number of DNS-causing terms evaluated is limited to 10.
  • Exceeding the limit produces permerror.
  • Temporary DNS failures and permanent policy errors are different results; ip4 and ip6 do not consume this term limit.

Examples are illustrative. Consult the linked RFC and its errata for implementation details.

Sources
Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

The envelope and the letter do different jobs.

Mail transport moves a message between servers. The message format describes its contents. Authentication adds checks; it does not make every message safe.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

All chapters in RFC 7208

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗