---
title: "How to Create an SPF TXT Record | AutoSPF"
description: "Sender Policy Framework or SPF prevents phishing and spoofing attacks by enabling domain owners to specify which IP addresses or servers they trust."
image: "https://autospf.com/og/blog/how-to-create-an-spf-txt-record.png"
canonical: "https://autospf.com/blog/how-to-create-an-spf-txt-record/"
---

Quick Answer

Sender Policy Framework or SPF prevents phishing and spoofing attacks by enabling domain owners to specify which IP addresses or servers they trust. These authorized IP addresses are enlisted in SPF TXT records. This blog focuses on understanding how to create an SPF TXT record for your domain.

Share 

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

![Create an SPF Record](https://media.mailhop.org/autospf/images/2023/06/spf-permerror-6490.jpg) 

Sender Policy Framework or SPF prevents phishing and [spoofing attacks](https://indianexpress.com/article/cities/mumbai/using-e-mail-spoofing-fraudster-dupes-bank-of-rs-9-94-lakh-7429133/) by enabling domain owners to specify which IP addresses or servers they trust. These authorized IP addresses are enlisted in SPF TXT records. This blog focuses on understanding how to create an SPF TXT record for your domain. 

_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 are SPF Records?

[SPF](https://www.duocircle.com/resources/how-to-create-an-spf-txt-record) records are TXT records that include all the email servers or IP addresses that domain owners allow sending emails from. Emails sent from IP addresses outside of the list are either marked as spam (SPF softfail) or outrightly rejected from entering recipients’ mailboxes (SPF hardfail).

Here’s an SPF TXT record example- 

```
v=spf1 ip4=145.0.1.0 ip4=145.0.2.1 include:examplesender.email -all
```

A correctly set up and configured SPF TXT record for your domain ensures email security, improves [email deliverability rate](https://sendpulse.com/support/glossary/delivery-rate#:~:text=Email%20delivery%20rates%20are%20calculated,some%20emails%20may%20have%20bounced.), and helps deploy DMARC protocol.

Now, let’s check out the 4 steps to create SPF TXT record online. 

![email deliverability rate](https://media.mailhop.org/autospf/images/2023/06/spf-lookup-7948.jpg) 

## How to Create Your SPF Record?

You can protect your brand reputation and shield your customers or prospects from falling into the traps set by [threat actors](https://www.techtarget.com/searchsecurity/news/366538419/Threat-actors-leverage-kernel-drivers-in-new-attacks) by starting your SPF journey. The first step of which is to know how to create SPF TXT records. 

### STEP 1: CREATE A LIST OF AUTHORIZED AND TRUSTED IP ADDRESSES

Draft an extensive list of IP addresses and servers allowed to send emails on behalf of your domain. Also, enlist if there are any third-party vendors permitted to send emails from your domain. 

Remember that you’ll have to create an SPF record for all the domains if you use multiple domains to send emails from your company.

### STEP 2: GENERATE YOUR SPF RECORD

1. Start with v=spf1, which specifies the version number.
2. v=spf1 has to be followed by all the IP addresses gathered in the first step.
3. Next, use an _include_ tag for third-party vendors’ email addresses.
4. Lastly, end your record with an _\~all_ or _\-all_ tag, where;

the \~all tag (Softfail) instructs recipients’ servers to accept emails failing authentication checks but mark them as spam. 

\-all tag instructs recipients’ servers to outrightly reject the entry of emails failing authentication checks.

### STEP 3: PUBLISH THE GENERATED SPF RECORD ON YOUR DNS

Once you’ve learned how to create an SPF TXT record and generated one for your domain, it’s time to publish it on your DNS. A DNS manager does this; now, this can be an internal role in your company, or you can ask your DNS provider to do it for you. You may also have access to a dashboard that your DNS provider offers; if so, you can add the SPF TXT record on your own. 

![DNS Manager](https://media.mailhop.org/autospf/images/2023/06/spf-record-checker-4879.jpg) 

#### How to Access Your DNS Manager?

1. Log in to your domain account.
2. Find an option/page to update the domain’s DNS records. It’ll read something like ‘DNS management’ or ‘name server management’.
3. Choose the domain you want to add the SPF record for and open the DNS manager.
4. Create a new TXT record in the TXT section and set the host field to your domain name.
5. Copy and paste your SPF record values.
6. Specify the [Time To Live (TTL)](https://www.techtarget.com/searchnetworking/definition/time-to-live), enter 3600, or leave the default.
7. Click on ‘add record,’ and you’re done.

It may take up to 48 hours for this to reflect. 

### STEP 4: TEST YOUR SPF RECORD

Use SPF record checker, an online diagnostic tool that examines your record for syntactical errors and other configurations. 

A correctly configured SPF record doesn’t exceed the 10 DNS lookup limit. However, if you’re struggling to stay within the limit, try our automatic SPF flattening services. 

## Conclusion

To create an SPF record for your domain, start by gathering all authorized IP addresses and generate a record using the above instructions. Then ask your DNS manager or DNS provider to add the record to your DNS. Lastly, use an [SPF checker](/free-spf-checker/) to verify that the record is correct and error-free.

![Vishal Lamba](https://media.mailhop.org/autospf/images/authors/vishal-lamba.jpg) 

[ Vishal Lamba ](/authors/vishal-lamba/) 

Content Specialist

Content Specialist at AutoSPF. Writes vendor-specific SPF configuration guides and troubleshooting walkthroughs.

[LinkedIn Profile →](https://www.linkedin.com/in/vishal-lamba/) 

## Ready to get started?

Try AutoSPF free — no credit card required.

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

## Related Articles

[  Foundational 17m  10 Reasons The SPF Standard Is Essential For Protecting Your Domain  Nov 20, 2025 ](/blog/10-reasons-the-spf-standard-is-essential-for-protecting-your-domain/)[  Foundational 5m  4 ChatGPT and AI-based scams to be wary of in the second half of 2024  Aug 16, 2024 ](/blog/4-ai-and-chatgpt-scams-to-watch-for-in-2024/)[  Foundational 6m  6 Steps to Outplay BEC Attackers  Feb 2, 2024 ](/blog/6-steps-to-outplay-bec-attackers/)[  Foundational 4m  7 Myths and Misconceptions about Sender Policy Framework  May 31, 2024 ](/blog/7-myths-and-misconceptions-about-sender-policy-framework/)

```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 to Create an SPF TXT Record","description":"Sender Policy Framework or SPF prevents phishing and spoofing attacks by enabling domain owners to specify which IP addresses or servers they trust.","url":"https://autospf.com/blog/how-to-create-an-spf-txt-record/","datePublished":"2023-06-07T19:41:17.000Z","dateModified":"2026-04-18T02:36:41.000Z","dateCreated":"2023-06-07T19:41:17.000Z","author":{"@type":"Person","@id":"https://autospf.com/authors/vishal-lamba/#person","name":"Vishal Lamba","url":"https://autospf.com/authors/vishal-lamba/","jobTitle":"Content Specialist","description":"Vishal Lamba writes AutoSPF's how-to guides and vendor-specific configuration walkthroughs. His work focuses on step-by-step implementation guides for major email platforms (Google Workspace, Microsoft 365, SendGrid, Mimecast, Proofpoint, Brevo, and others), troubleshooting common SPF errors, and translating RFC-level specifications into practical deployment procedures for IT administrators.","image":"https://media.mailhop.org/autospf/images/authors/vishal-lamba.jpg","knowsAbout":["SPF Vendor Configuration","Email Platform Integrations","SPF Troubleshooting","Technical Documentation","Step-by-Step Guides"],"worksFor":{"@type":"Organization","name":"AutoSPF","url":"https://autospf.com"},"sameAs":["https://www.linkedin.com/in/vishal-lamba/"]},"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-to-create-an-spf-txt-record/"},"articleSection":"foundational","keywords":"","wordCount":712,"image":{"@type":"ImageObject","url":"https://media.mailhop.org/autospf/images/2023/06/spf-permerror-6490.jpg","caption":"Create an SPF Record","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":"Foundational","item":"https://autospf.com/foundational/"},{"@type":"ListItem","position":4,"name":"How to Create an SPF TXT Record","item":"https://autospf.com/blog/how-to-create-an-spf-txt-record/"}]}
```
