Home/Guides/SPF Include Chains
SPF Configuration

SPF Include Chains

How nested SPF includes work, why they consume multiple DNS lookups, and strategies for managing complex multi-ESP email setups.

8 min read
Intermediate

What Are SPF Include Chains?

An SPF include chain occurs when one SPF record references another using the include: mechanism, and that referenced record contains its own include: statements. This creates a chain (or tree) of DNS lookups.

Simple Example:

Your domain: example.com
v=spf1 include:_spf.google.com -all

1 include statement (but not just 1 lookup!)

Google's SPF: _spf.google.com
v=spf1 include:_netblocks.google.com include:_netblocks2.google.com include:_netblocks3.google.com ~all

Google's record has 3 nested includes!

Total Lookups: 1 (your include) + 3 (Google's nested includes) = 4 DNS lookups from a single include!

Hidden Lookup Costs

When you add include:_spf.google.com, you're not consuming 1 lookup—you're consuming however many lookups Google's SPF record uses (currently 3-4).

How Include Chains Work: DNS Resolution Process

When a mail server checks your SPF record, it follows the include chain recursively:

Step-by-Step Resolution:

1
Lookup your domain's SPF record
TXT lookup: example.com

Returns: v=spf1 include:_spf.google.com -all

2
Follow the include (Lookup #1)
TXT lookup: _spf.google.com

Returns: v=spf1 include:_netblocks.google.com include:_netblocks2.google.com ...

3
Follow nested includes (Lookups #2, #3, #4...)
TXT lookup: _netblocks.google.comTXT lookup: _netblocks2.google.comTXT lookup: _netblocks3.google.com

Each nested include = additional lookup

4
Collect all IP addresses

Combine IP ranges from all included records into a single authorized sender list

Common ESP Include Chains & Their Lookup Costs

Different email service providers have different include chain depths. Here's what popular ESPs actually consume:

Google Workspace

3
include:_spf.google.com
→ include:_netblocks.google.com
→ include:_netblocks2.google.com
→ include:_netblocks3.google.com
Cost: 3 lookups

Microsoft 365

2
include:spf.protection.outlook.com
→ include:spf-a.outlook.com
(no further nesting)
Cost: 2 lookups

SendGrid

1
include:sendgrid.net
(no nested includes)
Cost: 1 lookup

Salesforce

3
include:_spf.salesforce.com
→ Multiple nested includes
Cost: 3 lookups

Mailchimp

1
include:servers.mcsv.net
(no nested includes)
Cost: 1 lookup

Zendesk

1
include:mail.zendesk.com
(no nested includes)
Cost: 1 lookup
Lookup Costs Change

ESPs can modify their SPF records anytime. Always verify current lookup counts with an SPF checker before making changes.

Calculating Total Lookups in Complex Chains

Here's how to calculate your total lookup count when using multiple ESPs:

Example: Multi-ESP Setup

Your SPF Record:
v=spf1 include:_spf.google.com include:sendgrid.net include:servers.mcsv.net mx -all
include:_spf.google.com3 lookups
include:sendgrid.net1 lookup
include:servers.mcsv.net1 lookup
mx1 lookup
Total:6 lookups

✓ Under the 10 lookup limit with 4 lookups to spare

Strategies for Managing Include Chains

1

Choose ESPs with Shallow Include Chains

When selecting email service providers, prefer those with fewer nested includes.

✓ Low Lookup ESPs (1 lookup):
  • • SendGrid
  • • Mailchimp
  • • Postmark
  • • Zendesk
⚠ High Lookup ESPs (3+ lookups):
  • • Google Workspace (3)
  • • Salesforce (3)
  • • Microsoft 365 (2)
2

Use Subdomains for High-Lookup ESPs

Offload heavy include chains to separate subdomains.

Main Domain (Primary Email):
example.com → v=spf1 include:sendgrid.net -all

Only 1 lookup

Marketing Subdomain (Salesforce):
marketing.example.com → v=spf1 include:_spf.salesforce.com -all

3 lookups (isolated)

3

Monitor ESP SPF Changes

ESPs can change their SPF records anytime, potentially adding nested includes.

  • Check SPF lookup count monthly
  • Subscribe to ESP change notifications
  • Use monitoring tools to track DNS changes
4

Consolidate Through SMTP Relay

Route all email through a single ESP to minimize includes.

Instead of adding includes for every service, configure third-party apps to send via your primary ESP:

Example:
• Primary ESP: SendGrid (1 lookup)
• Salesforce → send via SendGrid SMTP relay
• Zendesk → send via SendGrid SMTP relay
• Custom app → send via SendGrid SMTP relay

Result: Only 1 include instead of 4+

Best Practices

Do

  • → Test lookup count before deployment
  • → Document which ESPs use nested includes
  • → Leave 2-3 lookups of headroom
  • → Prefer ESPs with shallow include chains
  • → Use subdomains for complex setups

Don't

  • → Assume 1 include = 1 lookup
  • → Add includes without checking depth
  • → Max out at exactly 10 lookups
  • → Forget to recheck after ESP changes
  • → Mix too many high-lookup ESPs

Related Guides

Check Your Include Chain Depth

Use our free SPF Record Checker to analyze your include chains and see exactly how many lookups each ESP consumes.

Free SPF Tools