RFC 7208 SPF Lookup & Triple-Counter Workbench

Switch to DMARC & DKIM Workbench
Presets:
DNS-Querying Mechanisms13 / 10
RFC 7208 §4.6.4: include, a, mx, ptr, exists, redirect=
Max Per-MX / PTR Lookups2 / 10
RFC 7208 §4.6.4: Max 10 A/AAAA lookups per MX or PTR term
Void Lookups (NXDOMAIN / 0-RR)1 / 2
RFC 7208 §4.6.4: Status=3 or RCODE=0 with 0 matching answers
Verdict: PASS167 bytesResolver: synthetic-presetDoH Queries: 22/30
Normalized Root SPF Record (billing.acme-saas.example)
v=spf1 ip4:192.0.2.0/24 include:_spf.workspace-mail.example include:mail.helpdesk.example include:spf.crm-cloud.example mx exists:%{ir}._spf.mta.acme-saas.example ~all

RFC 7208 Diagnostics & Remediation

Macro-Dynamic mechanism 'exists:%{ir}._spf.mta.acme-saas.example' protected from false NXDOMAINRFC 7208 §7

Mechanism 'exists:%{ir}._spf.mta.acme-saas.example' on billing.acme-saas.example uses runtime RFC 7208 §7 macro(s) (%{ir}). Counted +1 toward the 10-lookup budget without querying literal '%{...}' over DNS.

PermError: Exceeded 10 DNS-querying mechanisms limit (13 / 10)RFC 7208 §4.6.4

Evaluating billing.acme-saas.example required 13 DNS-querying mechanisms/modifiers (include, a, mx, ptr, exists, redirect), violating the strict RFC 7208 §4.6.4 ceiling of 10. Receivers abort with PermError and fail SPF alignment.

Remediation: Move marketing/transactional vendors onto dedicated subdomains (e.g. mail.example.com, billing.example.com), replace 'a'/'mx' with static 'ip4:'/'ip6:' CIDRs where owned, and prune unused ESP includes.

1 / 2 void DNS lookup(s) detectedRFC 7208 §4.6.4

At least one mechanism resolved to NXDOMAIN or zero resource records. Exceeding 2 void lookups triggers RFC 7208 §4.6.4 PermError.

Recursive Lookup Tree

billing.acme-saas.exampleROOT TXT (0/10)
v=spf1 ip4:192.0.2.0/24 include:_spf.workspace-mail.example include:mail.helpdesk.example include:spf.crm-cloud.example mx exists:%{ir}._spf.mta.acme-saas.example ~all

Evaluated Mechanisms & Modifiers Breakdown

SlotSource DomainTermTarget / NetworkStatus & Notes
0 DNSbilling.acme-saas.exampleip4:192.0.2.0/24billing.acme-saas.exampleOK 0 DNS lookups
#1/10billing.acme-saas.exampleinclude:_spf.workspace-mail.example_spf.workspace-mail.examplePASS-MATCH
#2/10_spf.workspace-mail.exampleinclude:_netblocks1.workspace-mail.example_netblocks1.workspace-mail.examplePASS-MATCH
0 DNS_netblocks1.workspace-mail.exampleip4:198.51.100.0/24_netblocks1.workspace-mail.examplePASS-MATCH Matched simulated IP 198.51.100.44 (pass)
0 DNS_netblocks1.workspace-mail.example~all_netblocks1.workspace-mail.exampleOK SoftFail catch-all (~all)
#3/10_spf.workspace-mail.exampleinclude:_netblocks2.workspace-mail.example_netblocks2.workspace-mail.exampleOK
0 DNS_netblocks2.workspace-mail.exampleip6:2001:db8:10::/48_netblocks2.workspace-mail.exampleOK 0 DNS lookups
0 DNS_netblocks2.workspace-mail.example~all_netblocks2.workspace-mail.exampleOK SoftFail catch-all (~all)
0 DNS_spf.workspace-mail.example~all_spf.workspace-mail.exampleOK SoftFail catch-all (~all)
#4/10billing.acme-saas.exampleinclude:mail.helpdesk.examplemail.helpdesk.exampleOK
#5/10mail.helpdesk.examplea:out1.helpdesk.exampleout1.helpdesk.exampleOK Resolved 1 address(es)
#6/10mail.helpdesk.examplea:out2.helpdesk.exampleout2.helpdesk.exampleOK Resolved 1 address(es)
#7/10mail.helpdesk.examplea:out3.helpdesk.exampleout3.helpdesk.exampleOK Resolved 1 address(es)
0 DNSmail.helpdesk.example~allmail.helpdesk.exampleOK SoftFail catch-all (~all)
#8/10billing.acme-saas.exampleinclude:spf.crm-cloud.examplespf.crm-cloud.exampleOK
#9/10spf.crm-cloud.examplea:relay1.crm-cloud.examplerelay1.crm-cloud.exampleOK Resolved 1 address(es)
#10/10spf.crm-cloud.examplea:relay2.crm-cloud.examplerelay2.crm-cloud.exampleOK Resolved 1 address(es)
#11/10spf.crm-cloud.examplea:decommissioned-host.crm-cloud.exampledecommissioned-host.crm-cloud.exampleVOID Void lookup (NXDOMAIN / 0 address records)
0 DNSspf.crm-cloud.example~allspf.crm-cloud.exampleOK SoftFail catch-all (~all)
#12/10billing.acme-saas.examplemxbilling.acme-saas.exampleOK 2/10 per-MX host lookups
#13/10billing.acme-saas.exampleexists:%{ir}._spf.mta.acme-saas.example%{ir}._spf.mta.acme-saas.exampleMACRO-UNEXPANDED Short-circuited earlier (pass) — skipped expanding exists:%{ir}._spf.mta.acme-saas.example
0 DNSbilling.acme-saas.example~allbilling.acme-saas.exampleOK SoftFail catch-all (~all)

Air-Gapped Recursive CLI Diagnostics (dig & PowerShell)

Linux / macOS (Bash + dig)
# Air-gapped recursive SPF lookup counter (Bash + dig, option-injection & glob hardened)
( set -f; total=0;
  spf_walk() { local d="$1" seen="$2" pad="$3" c=0;
    [[ "$d" =~ ^[A-Za-z0-9._-]+$ && "$d" != -* && "$d" == *.* ]] || { printf "%s[rejected unsafe target: %s]\n" "$pad" "$d"; return; };
    [[ " $seen " == *" $d "* ]] && { printf "%sLOOP:%s\n" "$pad" "$d"; return; };
    local txt; txt=$(dig +short TXT -- "$d" | sed 's/" "//g; s/"//g' | grep -i '^v=spf1\([[:space:]]\|$\)' || true);
    printf "%s%-34s -> %s\n" "$pad" "$d" "${txt:-<NO_SPF>}";
    for tok in $txt; do local clean="${tok#[+~?-]}";
      case "$clean" in
        include:*) c=$((c+1)); total=$((total+1)); spf_walk "${clean#include:}" "$seen $d" "  $pad" ;;
        redirect=*) c=$((c+1)); total=$((total+1)); spf_walk "${clean#redirect=}" "$seen $d" "  $pad" ;;
        a|a:*|a/*|mx|mx:*|mx/*|ptr|ptr:*|exists:*) c=$((c+1)); total=$((total+1)) ;;
      esac;
    done; printf "%s  [local DNS terms on %s: %d]\n" "$pad" "$d" "$c"; };
  spf_walk 'billing.acme-saas.example' "" "";
  printf "Total RFC 7208 DNS-querying mechanisms: %d/10 (%s)\n" "$total" "$([ "$total" -le 10 ] && echo OK || echo PERMERROR)"; )
Windows Server (PowerShell Resolve-DnsName)
# Air-gapped recursive SPF lookup inspector (PowerShell Resolve-DnsName, injection hardened)
$script:SpfTotal = 0
function Show-SpfTree([string]$Domain, [string[]]$Seen = @(), [string]$Pad = '') {
  if ($Domain -notmatch '^[A-Za-z0-9._-]+$' -or $Domain.StartsWith('-') -or -not $Domain.Contains('.')) { Write-Warning ($Pad + "Rejected unsafe target: $Domain"); return }
  if ($Seen -contains $Domain) { Write-Warning ($Pad + "Loop detected: $Domain"); return }
  $txts = @(Resolve-DnsName -Name $Domain -Type TXT -ErrorAction SilentlyContinue | Where-Object { $_.Type -eq 'TXT' } | ForEach-Object { ($_.Strings -join '') } | Where-Object { $_ -match '^v=spf1(\s|$)' })
  Write-Host ("{0}{1} -> {2}" -f $Pad, $Domain, ($(if ($txts.Count) { $txts -join ' | ' } else { '<NO_SPF>' })))
  foreach ($t in ($txts -split '\s+')) {
    $clean = $t -replace '^[+~?-]',''
    if ($clean -match '^include:(.+)$') { $script:SpfTotal++; Show-SpfTree $Matches[1] ($Seen + $Domain) ($Pad + '  ') }
    elseif ($clean -match '^redirect=(.+)$') { $script:SpfTotal++; Show-SpfTree $Matches[1] ($Seen + $Domain) ($Pad + '  ') }
    elseif ($clean -match '^(a([:/].+)?|mx([:/].+)?|ptr(:.*)?|exists:.+)$') { $script:SpfTotal++ }
  }
}; Show-SpfTree 'billing.acme-saas.example'; Write-Host ("Total RFC 7208 DNS-querying mechanisms: {0}/10" -f $script:SpfTotal)

RFC 7208 Protocol Verification Rules

Specification RuleCeiling / BehaviorReceiver Verdict on Violation
RFC 7208 §4.6.4 Global DNS TermsMax 10 total across include, a, mx, ptr, exists, and redirect= (root TXT, ip4, ip6, all, exp= are exempt).PermError
RFC 7208 §4.6.4 Per-MX / Per-PTRMax 10 address (A/AAAA) lookups per individual mx or ptr mechanism (ptr truncates after 10 validated names).PermError (MX)
RFC 7208 §4.6.4 Void LookupsMax 2 DNS queries returning NXDOMAIN (RCODE 3) or NOERROR (RCODE 0) with 0 answers (Null MX 0 . excluded).PermError
RFC 7208 §4.5 Single Record RuleA domain MUST NOT publish more than one TXT RR beginning with v=spf1.PermError
RFC 7208 §3.3 Multi-String TXTAdjacent quoted strings inside a single TXT RR (>255 bytes) are concatenated directly without inserting spaces; CNAME (type=5) hops are filtered first.Concatenated

SPF Engineering Failure Modes & Remediation Guides

Fix SPF PermError: Too Many DNS Lookups (Exceeding the RFC 7208 10-Lookup Limit)Understand which SPF mechanisms count toward RFC 7208 §4.6.4's hard 10-lookup ceiling, why nested vendor includes blow the budget, and how to cut lookups safely.
RFC 7208 §4.6.4 (DNS Lookup Limits: 10-Mechanism Ceiling)
Fix SPF Void Lookups Limit Exceeded (>2 NXDOMAIN or Empty DNS Answers)Why dead SaaS includes and non-existent A/MX mechanisms trigger RFC 7208 §4.6.4 PermError after just 2 void lookups, even when total lookups are under 10.
RFC 7208 §4.6.4 (Void Lookups Limit of 2)
Fix Multiple SPF TXT Records PermError: How to Merge Two v=spf1 Records SafelyWhy publishing two separate v=spf1 TXT records on the same hostname triggers immediate RFC 7208 §4.5 PermError, and the exact algorithm to merge them into one.
RFC 7208 §3.2 (Multiple DNS Records: Single v=spf1 Requirement)
Split Long SPF & DKIM TXT Records Over 255 Characters Without Whitespace CorruptionHow RFC 1035 255-octet character-strings concatenate WITHOUT spaces per RFC 7208 §3.3, fixing include:fooinclude:bar boundary fusion bugs in BIND, Route53, and Terraform.
RFC 1035 §3.3.14 (TXT RDATA 255-Octet <character-string> Limit)
SPF ~all (SoftFail) vs -all (HardFail) Under DMARC Enforcement: RFC Truth & ForwardingCompare SPF ~all SoftFail, -all Fail, and ?all Neutral under RFC 7208 and RFC 7489 DMARC, including why forwarded DKIM-signed mail interacts differently with -all.
RFC 7208 §8.4 (Fail '-all') & §8.5 (SoftFail '~all')
Remove Deprecated SPF ptr Mechanism and Fix Per-MX (>10) Lookup ExplosionsWhy RFC 7208 §5.5 officially deprecated the SPF ptr mechanism, how mx mechanisms trigger hidden secondary 10-lookup PermErrors, and how to replace both.
RFC 7208 §5.5 ('ptr' Mechanism: DO NOT USE / Deprecated)
SPF Macros Explained: exists:%{i}, %{ir}, %{d}, and Why Naive Checkers Falsely ErrorDecode RFC 7208 §7 dynamic SPF macros (%{i}, %{ir}, %{s}, %{d}, %{h}) used by Salesforce, Proofpoint, and Mimecast, and prevent false NXDOMAIN void-lookup errors.
RFC 7208 §7 (Macros: %{s}, %{l}, %{o}, %{d}, %{i}, %{v}, %{h}, Transformers 'r' & Digits)
Why Manual Static SPF IP Flattening Breaks Production Email (And Safer Alternatives)Understand how inlining ip4:/ip6: CIDRs from Google, Microsoft, or SendGrid causes silent delivery outages when cloud netblocks rotate, plus zero-maintenance alternatives.
RFC 7208 §4.6.4 (Lookup Limits vs Operational Maintainability)
Subdomain SPF & Return-Path Architecture: Isolate Transactional, Marketing, and Corporate MailDesign clean DNS authentication boundaries across corporate (@example.com), transactional (@notify.example.com), and marketing (@news.example.com) streams.
RFC 7208 §2.4 (Checking MAIL FROM & HELO Identities)
SPF redirect= Modifier vs include: Mechanism: Precedence, Fallback, and Silent Ignore TrapsLearn the exact RFC 7208 §5.2 vs §6.1 execution difference between include: and redirect=, including why combining redirect= with ~all/-all silently disables redirect=.
RFC 7208 §5.2 ('include' Mechanism Match/No-Match Table)
Google Workspace + Microsoft 365 Dual SPF Setup (M&A Split Delivery Without PermError)Configure clean SPF, DKIM, and DMARC during Google Workspace to Microsoft 365 migrations or M&A co-existence while keeping total DNS lookups at 6/10.
RFC 7208 §4.6.4 (Lookup Budget: Google 4 + Microsoft 2 = 6 Lookups)
Protect Parked Domains & Non-Mail Hosts with Null SPF (v=spf1 -all), Null MX, and DMARC RejectLock down parked domains, API/CDN subdomains, and defensive lookalike domains in 4 DNS lines using RFC 7208 v=spf1 -all, RFC 7505 Null MX, and DMARC p=reject.
RFC 7208 §4.5 & §8.4 (Empty 'v=spf1 -all' Zero-Sender Policy)

Email Authentication & Delivery Infrastructure

PostmarkTransactional Email Infrastructure

Dedicated transactional delivery streams with custom Return-Path subdomain SPF alignment and 2048-bit DKIM signing.

MailgunProgrammable SMTP & Email API

High-volume API mail relay with automated DKIM key rotation, subdomain isolation, and structured bounce telemetry.

EasyDMARCManaged SPF & DMARC RUA Analytics

Automated XML aggregate report ingestion and dynamic SPF flattening to stay under the 10-lookup ceiling without stale netblocks.