---
title: "SPF format explanation- Basic and advanced | AutoSPF"
description: "An SPF record includes the servers and IP ranges a domain owner allows to be used to send emails on behalf of their brand."
image: "https://autospf.com/og/blog/spf-format-explanation-basic-and-advanced.png"
canonical: "https://autospf.com/blog/spf-format-explanation-basic-and-advanced/"
---

Quick Answer

An SPF record includes the servers and IP ranges a domain owner allows to be used to send emails on behalf of their brand. It’s composed of syntaxes, primarily categorized as SPF mechanisms, SPF qualifiers, and SPF modifiers. The combination of these syntaxes lets domain owners clearly convey how they want the receiving servers to handle unauthorized emails sent on their behalf.

Share 

[ ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fautospf.com%2Fblog%2Fspf-format-explanation-basic-and-advanced%2F "Share on LinkedIn") [ ](https://twitter.com/intent/tweet?text=SPF%20format%20explanation-%20Basic%20and%20advanced&url=https%3A%2F%2Fautospf.com%2Fblog%2Fspf-format-explanation-basic-and-advanced%2F "Share on X/Twitter") [ ](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fautospf.com%2Fblog%2Fspf-format-explanation-basic-and-advanced%2F "Share on Facebook") [ ](https://reddit.com/submit?url=https%3A%2F%2Fautospf.com%2Fblog%2Fspf-format-explanation-basic-and-advanced%2F&title=SPF%20format%20explanation-%20Basic%20and%20advanced "Share on Reddit") [ ](mailto:?subject=SPF%20format%20explanation-%20Basic%20and%20advanced&body=Check out this article: https%3A%2F%2Fautospf.com%2Fblog%2Fspf-format-explanation-basic-and-advanced%2F "Share via Email") 

![SPF format](https://media.mailhop.org/autospf/images/2025/01/spf-flattening-3.jpg) 

An SPF record includes the servers and IP ranges a domain owner allows to be used to send emails on behalf of their brand. It’s composed of syntaxes, primarily categorized as SPF mechanisms, SPF qualifiers, and SPF modifiers. The combination of these syntaxes lets domain owners clearly convey how they want the receiving servers to handle [unauthorized emails](https://news.trendmicro.com/2023/12/05/unauthorized-log-in-attempt-notification-email/) sent on their behalf. 

SPF records are complex and have a format. _Not having the knowledge of the format makes your SPF record erroneous, which ultimately makes it invalid_. This blog explains the basic and advanced syntaxes. 

## SPF records basic syntax

An SPF record is a [TXT record](https://en.wikipedia.org/wiki/TXT%5Frecord) that is published in your domain’s DNS to prevent [phishing and spoofing](https://www.bleepingcomputer.com/news/google/google-now-blocks-spoofed-emails-for-better-phishing-protection/). Here’s an example of a standard SPF record-

v=spf1 ip4=203.0.113.42 include:\_spf.google.com include:company.com -all

This is what each element included in this example means-

- v=spf1: This tells the [mail server](https://www.cloudflare.com/learning/email-security/what-is-a-mail-server/) that the specific [DNS record](https://www.techopedia.com/definition/5349/dns-record) is an SPF record. All SPF records must start with this.
- ip4=203.0.113.42 ip4=203.0.113.43: These are the [IP addresses](https://www.fortinet.com/resources/cyberglossary/what-is-ip-address) that are allowed to send emails on behalf of the domain. Only emails sent from these addresses will be considered valid.
- include:\_spf.google.com: This allows a [third-party service](https://getterms.io/blog/what-is-a-third-party-service) (in this case, spf.google.com) to send emails on behalf of the domain. _The ‘include’ tag tells recipient servers to check the SPF record of the included domain (spf.google.com) to confirm it’s authorized_.
- \-all: This means any email sent from IP addresses not listed in the SPF record should be rejected as unauthorized. It ensures stricter [email security](/) by blocking unapproved senders.

## SPF records advanced syntax

As mentioned above, the advanced syntaxes are categorically divided into mechanisms, modifiers, and qualifiers. 

### 1\. SPF mechanisms

- all: _This means it always matches. You’ll commonly see defaults like -all to handle unmatched IPs_.
- a: Matches if the domain name has an A or AAAA record that resolves to the sender’s address.
- ip4: Matches when the sender’s IP falls within the specified IPv4 address range.
- ip6: Matches when the sender’s IP falls within the specified IPv6 address range.
- mx: Validates the sender’s email only if the domain name has an [MX record](https://www.digicert.com/faq/dns/what-is-an-mx-record) that resolves properly.
![PTR record](https://media.mailhop.org/autospf/images/2025/01/spf-validator-1.jpg) 
- ptr: Matches if the [PTR record](https://www.namecheap.com/support/knowledgebase/article.aspx/10057/10/what-is-ptr-record/) corresponds to a domain that resolves to the client’s address. _However, experts advise against using this as it can unintentionally block all emails from your domain_.
- exists: Matches if the specified domain name resolves to an address. This mechanism validates any resolved addresses.
- include: Refers to policies from other domains. If the included policy passes, it’s accepted automatically. If it fails, processing continues.

### 2\. SPF modifiers

Modifiers shape how an [SPF record](/spf-record-checker/create-spf-record/) works. They are written as name-value pairs separated by \`=\`, providing extra details. _Modifiers often appear at the end of an SPF record, and any unrecognized ones are ignored_.

The \`redirect\` modifier points to another SPF record, helping manage multiple domains under the same setup. It’s best used when a single organization controls all the domains. The \`include\` modifier is a better choice if different entities manage the domains.

### 3\. SPF qualifiers

[SPF](/blog/what-is-spf-email-a-guide-to-sender-validation-technology/) qualifiers define how recipient mail servers should treat emails that match or fail a specific rule. There are four qualifiers:

- \`+\` (Pass): Indicates that the email comes from an authorized sender. This is the default qualifier and can be omitted.
- \`-\` (Fail): Specifies that emails from this source should be rejected outright.
- \`\~\` (SoftFail): _Means the email is likely unauthorized but should not be outright rejected. It is typically flagged or treated as suspicious_.
- \`?\` (Neutral): No specific action is recommended, and the email is neither accepted nor rejected based on the [SPF check](/generative-ai-and-phishing-threats/spf-records-check/).

## Complementing SPF with DKIM and DMARC

Using DMARC alongside SPF and DKIM creates a stronger defense against [email-based attacks](https://www.prnewswire.com/news-releases/conversation-hijacking-up-70-and-1-in-10-email-based-attacks-are-now-business-email-compromise-302174802.html) and enhances [email deliverability](/blog/how-does-spf-help-marketers-in-improving-email-deliverability/). DMARC addresses SPF’s shortcomings, offering a more flexible and comprehensive framework for email authentication.

One key limitation of SPF is its lack of a standard way for domain owners to receive feedback on how their emails are being authenticated across various servers. [DMARC](/10-reasons-for-regular-spf-record-checks-in-cybersecurity/dmarc-record-check/) solves this by introducing reporting mechanisms, allowing domain owners to receive detailed DMARC reports that show the results of SPF and DKIM checks.

SPF checks can fail during [email forwarding](https://clean.email/blog/email-management/automatic-email-forwarding) because the forwarding server is not listed in the original sender’s SPF record. _DMARC helps address this issue by allowing domain owners to define how to handle emails that fail authentication, such as forwarding them with modified headers_.

![email authentication](https://media.mailhop.org/autospf/images/2025/01/spf-flattening-8712.jpg) 

With DMARC, domain owners can specify how receiving servers should deal with emails that fail SPF or DKIM checks. This provides more flexibility, enabling tailored [email authentication](/spf-too-many-dns-lookups/spf-lookup/) policies.

DMARC also introduces the concept of alignment, ensuring that the domain in the ‘From’ header matches the domain authenticated by SPF and/or [DKIM](/10-reasons-for-regular-spf-record-checks-in-cybersecurity/dkim-record-check/). This alignment strengthens email authentication and prevents [domain spoofing](https://www.pcmag.com/news/nsa-warns-of-north-korean-hackers-spoofing-emails-from-legit-domains).

## Topics

[ DKIM ](/tags/dkim/)[ DMARC ](/tags/dmarc/)[ email security ](/tags/email-security/)[ SPF ](/tags/spf/)[ SPF record ](/tags/spf-record/) 

![Brad Slavin](https://media.mailhop.org/autospf/images/authors/brad-slavin.jpg) 

[ Brad Slavin ](/authors/brad-slavin/) 

General Manager

Founder and General Manager of DuoCircle. Product strategy and commercial lead for AutoSPF's 2,000+ customer base.

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

## 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 5m  Are Your SPF and DKIM Identifiers Aligned?  Jul 18, 2024 ](/blog/are-your-spf-and-dkim-identifiers-aligned/)[  Intermediate 6m  Automated Solutions for Preventing Email Spoofing  May 7, 2026 ](/blog/automated-solutions-for-preventing-email-spoofing/)[  Intermediate 7m  AutoSPF Explains: The Definitive Guide to Adding an SPF Record to Cloudflare  Jan 7, 2026 ](/blog/autospf-definitive-guide-adding-spf-record-cloudflare/)

```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":"SPF format explanation- Basic and advanced","description":"An SPF record includes the servers and IP ranges a domain owner allows to be used to send emails on behalf of their brand.","url":"https://autospf.com/blog/spf-format-explanation-basic-and-advanced/","datePublished":"2025-01-10T18:51:16.000Z","dateModified":"2026-04-18T02:36:41.000Z","dateCreated":"2025-01-10T18:51:16.000Z","author":{"@type":"Person","@id":"https://autospf.com/authors/brad-slavin/#person","name":"Brad Slavin","url":"https://autospf.com/authors/brad-slavin/","jobTitle":"General Manager","description":"Brad Slavin is the founder and General Manager of DuoCircle, the company behind AutoSPF, DMARC Report, Phish Protection, and Mailhop. He founded DuoCircle in 2014 to solve the SPF 10-DNS-lookup problem at scale and has led the company's growth to 2,000+ customers. Brad's focus is product strategy, customer relationships, and the commercial and compliance side of email authentication (DPAs, SLAs, enterprise procurement) rather than hands-on DNS engineering.","image":"https://media.mailhop.org/autospf/images/authors/brad-slavin.jpg","knowsAbout":["Email Security Strategy","SaaS Product Management","Enterprise Compliance","Customer Success","Email Deliverability Business"],"worksFor":{"@type":"Organization","name":"AutoSPF","url":"https://autospf.com"},"sameAs":["https://www.linkedin.com/in/bradslavin"]},"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/spf-format-explanation-basic-and-advanced/"},"articleSection":"intermediate","keywords":"DKIM, DMARC, email security, SPF, SPF record","wordCount":795,"image":{"@type":"ImageObject","url":"https://media.mailhop.org/autospf/images/2025/01/spf-flattening-3.jpg","caption":"SPF format","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":"SPF format explanation- Basic and advanced","item":"https://autospf.com/blog/spf-format-explanation-basic-and-advanced/"}]}
```
