---
title: "How does SPF flattening simplify DNS records? | AutoSPF"
description: "Each SPF record should not have more than 10 DNS lookups; otherwise, validation failures are triggered."
image: "https://autospf.com/og/blog/how-does-spf-flattening-simplify-dns-records.png"
canonical: "https://autospf.com/blog/how-does-spf-flattening-simplify-dns-records/"
---

Quick Answer

Each SPF record should not have more than 10 DNS lookups; otherwise, validation failures are triggered. SPF records of organizations with an intricate email infrastructure are more likely to hit this limit and experience permanent errors. This is where the process of SPF flattening steps in to keep the records within the limit of 10 queries, helping in improving email deliverability and compliance.

Share 

[ ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fautospf.com%2Fblog%2Fhow-does-spf-flattening-simplify-dns-records%2F "Share on LinkedIn") [ ](https://twitter.com/intent/tweet?text=How%20does%20SPF%20flattening%20simplify%20DNS%20records%3F&url=https%3A%2F%2Fautospf.com%2Fblog%2Fhow-does-spf-flattening-simplify-dns-records%2F "Share on X/Twitter") [ ](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fautospf.com%2Fblog%2Fhow-does-spf-flattening-simplify-dns-records%2F "Share on Facebook") [ ](https://reddit.com/submit?url=https%3A%2F%2Fautospf.com%2Fblog%2Fhow-does-spf-flattening-simplify-dns-records%2F&title=How%20does%20SPF%20flattening%20simplify%20DNS%20records%3F "Share on Reddit") [ ](mailto:?subject=How%20does%20SPF%20flattening%20simplify%20DNS%20records%3F&body=Check out this article: https%3A%2F%2Fautospf.com%2Fblog%2Fhow-does-spf-flattening-simplify-dns-records%2F "Share via Email") 

![email infrastructure](https://media.mailhop.org/autospf/images/2025/03/spf-record-checker-5831.jpg) 

Each SPF record should not have more than 10 DNS lookups; otherwise, validation failures are triggered. [SPF records](/blog/spf-record-for-google-a-complete-guide-to-dns-configuration/) of organizations with an intricate [email infrastructure](https://www.voilanorbert.com/blog/email-infrastructure/) are more likely to hit this limit and experience permanent errors. This is where the process of SPF flattening steps in to keep the records within the limit of 10 queries, helping in improving email deliverability and compliance. 

> “The misconception about SPF flattening is that it’s a one-time fix,” says Adam Lundrigan, CTO of DuoCircle and architect of AutoSPF’s flattening engine. “Vendor IP ranges change constantly - Google rotated their \_netblocks three times in 2025 alone. A flattened record that isn’t automatically re-resolved goes stale and silently de-authorizes legitimate senders. That’s why AutoSPF re-scans every 15 minutes.”

> “The 10-lookup limit is the single most common reason enterprise SPF records silently break,” says Brad Slavin, General Manager of DuoCircle and founder of AutoSPF. “In our experience managing SPF for 2,000+ customer domains, the failure mode is always the same: a team adds a new SaaS tool, its include pushes the total past 10, and legitimate email starts failing - but nobody notices until a customer complains about missing invoices or password resets.”

_Per [RFC 7208](https://datatracker.ietf.org/doc/html/rfc7208), SPF evaluation is capped at 10 DNS mechanism lookups and 2 void lookups per check - exceeding either limit produces a `PermError` that fails authentication for every message from the domain._

## What is SPF flattening?

SPF flattening reduces the number of [DNS lookups](https://www.digicert.com/faq/dns/how-does-dns-lookup-work) by simplifying and optimizing SPF records. _It helps domain owners stay within the limit specified by RFC by consolidating nested ‘include:’ statements and replacing indirect references with corresponding IPs_. This turns the SPF record into a single, comprehensive entity.

## How is SPF flattening done?

You can manually flatten an SPF record, but that’s a bit time and resource-consuming. Moreover, this approach has a higher chance of errors and misconfigurations. So, it’s better to use [automatic SPF flattening tools](/).

Nonetheless, here is how you can do it manually-

- Check SPF records, Find all includes and nested lookups.
- Simplify lookups, Replace includes with direct IPs or [CIDR](https://www.geeksforgeeks.org/classless-inter-domain-routing-cidr/) ranges.
- Test the record, Review it manually in DNS or use an online [SPF checker](/blog/spf-record-checker-why-you-need-it/) to confirm it works properly.

## Why Is SPF flattening Important?

Here’s why SPF flattening is beneficial for SPF records that have exceeded the lookup limit-

### Staying compliant

SPF records must follow DNS lookup limits. Flattening helps keep them within these limits, ensuring compliance with the [RFC](https://www.techtarget.com/whatis/definition/Request-for-Comments-RFC) rules set by the IETF for email authentication and maintaining your domain’s trustworthiness with [email servers](https://www.one.com/en/email/what-is-an-email-server).

![email server](https://media.mailhop.org/autospf/images/2025/03/spf-record-checker-5832.jpg) 

### Enhanced email deliverability

_When an SPF record is configured correctly and has no permerrors triggering, it efficiently performs authentication checks_. If all your outgoing emails undergo authentication checks and are correctly categorized as legitimate and illegitimate, receiving mailboxes will start perceiving your domain as credible and valuable. This leads to enhanced [email deliverability](/spf-validation-failed-meaning-and-troubleshooting-methods/spf-validation-error/), which means most of your emails will land in the primary inboxes of recipients.

### Prevention from phishing and spoofing

Using SPF with [DMARC](https://dmarcreport.com/) and flattening SPF helps prevent [phishing and spoofing](https://www.msspalert.com/brief/novel-usps-spoofing-phishing-attack-relies-on-malicious-pdfs). If SPF exceeds the limit, it can fail, causing DMARC to fail even for genuine emails. Moreover, [threat actors](https://www.nbcnews.com/tech/security/us-treasury-says-computers-hacked-chinese-threat-actor-rcna185809) are adept at exploiting vulnerabilities in email authentication protocols. So, if your SPF record exceeds the lookup limit, they know how to pivot that to their advantage, send [phishing emails](https://thehackernews.com/2024/07/proofpoint-email-routing-flaw-exploited.html) from your domain, and bypass authentication filters. 

## Don’t underestimate frequent evaluations

SPF records change frequently as email providers update their IPs and servers. Manually flattened SPF records can become outdated, causing lookup errors, so regular reviews are essential. 

![SPF records](https://media.mailhop.org/autospf/images/2025/03/spf-flattening-9843.jpg) 

Overcomplicated [SPF](/blog/what-is-spf-email-a-guide-to-sender-validation-technology/) setups can lead to errors. _Flattening replaces ‘include:’ statements with IPs, which may make the record too long (over 255 characters), so manage it carefully_.

Use our free automatic SPF flattening tool if your SPF record has exceeded the limit and you are not able to fix it despite every effort. [Contact us](/contact-us/) for any help.

## Topics

[ DMARC ](/tags/dmarc/)[ SPF ](/tags/spf/)[ SPF Flattening ](/tags/spf-flattening/)[ SPF Flattening tool ](/tags/spf-flattening-tool/)[ SPF record ](/tags/spf-record/) 

![Adam Lundrigan](https://media.mailhop.org/autospf/images/authors/adam-lundrigan.jpg) 

[ Adam Lundrigan ](/authors/adam-lundrigan/) 

CTO

CTO of DuoCircle. Architect of AutoSPF's SPF flattening engine and DNS monitoring infrastructure.

[LinkedIn Profile →](https://www.linkedin.com/in/adamlundrigan/) 

## Ready to get started?

Try AutoSPF free — no credit card required.

[ Book a Demo ](/book-a-demo/) 

## Related Articles

[  Intermediate 3m  3 points to consider before setting your SPF record to -all (HardFail)  May 22, 2025 ](/blog/3-points-to-consider-before-setting-your-spf-record-hardfail/)[  Intermediate 6m  6 Best practices for maintaining an SPF record  Jun 5, 2025 ](/blog/6-best-practices-for-maintaining-an-spf-record/)[  Intermediate 6m  Your SPF record is broken- What does it mean and how do you fix it?  Jan 16, 2025 ](/blog/broken-spf-record-meaning-and-how-to-fix-it/)[  Intermediate 6m  Broken SPF record- What does it mean and how to fix it!  Mar 13, 2025 ](/blog/broken-spf-record-what-does-it-mean-and-how-to-fix-it/)

```json
{"@context":"https://schema.org","@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897474","name":"AutoSPF","url":"https://autospf.com","logo":{"@type":"ImageObject","url":"https://autospf.com/images/autospf-logo.png"},"description":"Automatic SPF flattening and email authentication management. Resolve SPF lookup limits, flatten SPF records, and maintain email deliverability across all your domains.","parentOrganization":{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138883901","name":"DuoCircle LLC","url":"https://www.duocircle.com","sameAs":["https://www.wikidata.org/wiki/Q138883901","https://www.crunchbase.com/organization/duocircle-llc","https://www.linkedin.com/company/duocircle","https://github.com/duocircle"],"subOrganization":[{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138898167","name":"DMARC Report","url":"https://dmarcreport.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897474","name":"AutoSPF","url":"https://autospf.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897912","name":"Phish Protection","url":"https://www.phishprotection.com"}]},"sameAs":["https://www.wikidata.org/wiki/Q138897474","https://www.linkedin.com/company/autospf","https://x.com/autospf01","https://www.g2.com/products/autospf/reviews"],"contactPoint":{"@type":"ContactPoint","contactType":"customer support","url":"https://autospf.com/contact-us/"},"knowsAbout":["SPF Record Flattening","Sender Policy Framework","Email Authentication","DNS Management","DMARC","DKIM"]}
```

```json
{"@context":"https://schema.org","@type":"WebSite","name":"AutoSPF","url":"https://autospf.com","description":"Automatic SPF flattening and email authentication management. Resolve SPF lookup limits, flatten SPF records, and maintain email deliverability across all your domains.","publisher":{"@type":"Organization","name":"AutoSPF","url":"https://autospf.com","logo":{"@type":"ImageObject","url":"https://autospf.com/images/autospf-logo.png"},"description":"Automatic SPF flattening and email authentication management. Resolve SPF lookup limits, flatten SPF records, and maintain email deliverability across all your domains.","parentOrganization":{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138883901","name":"DuoCircle LLC","url":"https://www.duocircle.com","sameAs":["https://www.wikidata.org/wiki/Q138883901","https://www.crunchbase.com/organization/duocircle-llc","https://www.linkedin.com/company/duocircle","https://github.com/duocircle"],"subOrganization":[{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138898167","name":"DMARC Report","url":"https://dmarcreport.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897474","name":"AutoSPF","url":"https://autospf.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897912","name":"Phish Protection","url":"https://www.phishprotection.com"}]}}}
```

```json
{"@context":"https://schema.org","@type":"BlogPosting","headline":"How does SPF flattening simplify DNS records?","description":"Each SPF record should not have more than 10 DNS lookups; otherwise, validation failures are triggered.","url":"https://autospf.com/blog/how-does-spf-flattening-simplify-dns-records/","datePublished":"2025-03-21T17:59:59.000Z","dateModified":"2026-04-18T02:36:41.000Z","dateCreated":"2025-03-21T17:59:59.000Z","author":{"@type":"Person","@id":"https://autospf.com/authors/adam-lundrigan/#person","name":"Adam Lundrigan","url":"https://autospf.com/authors/adam-lundrigan/","jobTitle":"CTO","description":"Adam Lundrigan is the Chief Technology Officer of DuoCircle, where he leads engineering and is responsible for the architecture of AutoSPF's SPF flattening engine and DNS monitoring infrastructure. His technical focus is the DNS-level behavior of SPF evaluation, the recursive include resolution logic that underpins flattening, and the monitoring systems that keep customer SPF records healthy as their upstream vendors change IP ranges.","image":"https://media.mailhop.org/autospf/images/authors/adam-lundrigan.jpg","knowsAbout":["SPF Flattening","DNS Architecture","Recursive Include Resolution","SaaS Engineering","DNS Monitoring","Infrastructure Automation"],"worksFor":{"@type":"Organization","name":"AutoSPF","url":"https://autospf.com"},"sameAs":["https://www.linkedin.com/in/adamlundrigan/"]},"publisher":{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897474","name":"AutoSPF","url":"https://autospf.com","logo":{"@type":"ImageObject","url":"https://autospf.com/images/autospf-logo.png"},"description":"Automatic SPF flattening and email authentication management. Resolve SPF lookup limits, flatten SPF records, and maintain email deliverability across all your domains.","parentOrganization":{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138883901","name":"DuoCircle LLC","url":"https://www.duocircle.com","sameAs":["https://www.wikidata.org/wiki/Q138883901","https://www.crunchbase.com/organization/duocircle-llc","https://www.linkedin.com/company/duocircle","https://github.com/duocircle"],"subOrganization":[{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138898167","name":"DMARC Report","url":"https://dmarcreport.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897474","name":"AutoSPF","url":"https://autospf.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897912","name":"Phish Protection","url":"https://www.phishprotection.com"}]},"sameAs":["https://www.wikidata.org/wiki/Q138897474","https://www.linkedin.com/company/autospf","https://x.com/autospf01","https://www.g2.com/products/autospf/reviews"],"contactPoint":{"@type":"ContactPoint","contactType":"customer support","url":"https://autospf.com/contact-us/"},"knowsAbout":["SPF Record Flattening","Sender Policy Framework","Email Authentication","DNS Management","DMARC","DKIM"]},"mainEntityOfPage":{"@type":"WebPage","@id":"https://autospf.com/blog/how-does-spf-flattening-simplify-dns-records/"},"articleSection":"intermediate","keywords":"DMARC, SPF, SPF Flattening, SPF Flattening tool, SPF record","wordCount":488,"image":{"@type":"ImageObject","url":"https://media.mailhop.org/autospf/images/2025/03/spf-record-checker-5831.jpg","caption":"email infrastructure","width":900,"height":600},"speakable":{"@type":"SpeakableSpecification","cssSelector":[".answer-block","h1"]}}
```

```json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://autospf.com/"},{"@type":"ListItem","position":2,"name":"Blog","item":"https://autospf.com/blog/"},{"@type":"ListItem","position":3,"name":"Intermediate","item":"https://autospf.com/intermediate/"},{"@type":"ListItem","position":4,"name":"How does SPF flattening simplify DNS records?","item":"https://autospf.com/blog/how-does-spf-flattening-simplify-dns-records/"}]}
```
