How to Create an SPF Record
A step-by-step guide to setting up Sender Policy Framework for your domain — protect your emails from spoofing and improve deliverability.
What is an SPF Record?
An SPF record (Sender Policy Framework) is a DNS TXT record that specifies which mail servers are authorized to send emails on behalf of your domain. When a receiving server gets an email, it checks the SPF record to verify the sender's IP address is on the approved list.
Think of your SPF record as a bouncer at the entrance to a private club. Only servers on the guest list can send emails from your domain. If an unauthorized server tries to send email pretending to be you, the SPF check fails and the message can be marked as spam or rejected outright.
Without a proper SPF record, malicious actors can spoof your domain to send phishing emails. According to cybersecurity research, nearly 97% of phishing attacks rely on email spoofing — making SPF an essential layer of defense.
7 Steps to Create Your SPF Record
Identify Your Domain
Determine the domain name that appears in emails you send (e.g., mybusiness.com). Ensure you are creating the SPF record for the correct domain to avoid mail delivery issues.
List Authorized IP Addresses and Servers
Compile a list of all IP addresses, hostnames, and third-party services (like Google Workspace, Mailchimp, or your hosting provider) that are permitted to send emails on behalf of your domain.
Format Your SPF Record
Build your SPF record string starting with "v=spf1" followed by the mechanisms that define which IPs are permitted. For example: v=spf1 ip4:192.0.2.0 include:_spf.google.com -all
Access Your DNS Management Console
Log in to your domain registrar or hosting provider (e.g., GoDaddy, Cloudflare) and navigate to the DNS Management or Zone File Settings page where you can modify TXT records.
Add the SPF TXT Record to DNS
Create a new TXT record with "@" in the host field (for the root domain) and paste your formatted SPF record string in the value field. Double-check for typos before saving.
Save and Wait for Propagation
Save your changes. DNS modifications can take anywhere from a few minutes to 48 hours to propagate across networks worldwide.
Verify Your SPF Record
Use tools like MxToolbox, Kitterman SPF, or AutoSPF's SPF Record Checker to confirm your SPF record is correctly configured. Send test emails to external accounts to verify they land in the inbox.
SPF Record Examples
Basic (Single Server)
v=spf1 ip4:192.0.2.1 -all
Authorizes one IP address; rejects all others.
Google Workspace
v=spf1 include:_spf.google.com ~all
Authorizes Google's mail servers with a soft fail for others.
Multiple Services
v=spf1 ip4:192.0.2.1 include:_spf.google.com include:servers.mcsv.net -all
Authorizes your server, Google, and Mailchimp.
Office 365
v=spf1 include:spf.protection.outlook.com -all
Authorizes Microsoft 365 mail servers.
Common SPF Issues
Too Many DNS Lookups
SPF allows a maximum of 10 DNS lookups. Each include, a, mx, and redirect counts as a lookup. Learn how to fix this →
Multiple SPF Records
A domain must have only one SPF TXT record. Multiple records cause validation failures. Merge all authorized sources into a single record.
Syntax Errors
Extra spaces, typos, or incorrect qualifiers can invalidate your SPF record. Always validate with an SPF checker after making changes. SPF error troubleshooting guide →
Skip the manual work
AutoSPF automatically flattens and manages your SPF record — setup takes less than 60 seconds.
Easy Setup, Instant Results
"Simple Solution for a Large Problem"
Simple to use and easy to deploy! Moreover, administration and maintenance of our SPF record is super simple.
Glenn G.
Enterprise (> 1000 emp.)
"A very professional service"
The service is simple, easy, and fast and has a straightforward dashboard for updating the data. The team is very kind, and helpful with fast replies. Basically jumping into our help. Top service with top experts!
Mihai K.
Enterprise (> 1000 emp.)