SPF Record Generator
Pick the services that send email for your domain and get one valid SPF TXT record, with the DNS lookup count checked for you.
Email services you use
include:_spf.google.com
include:spf.protection.outlook.com
include:zohomail.com
include:amazonses.com
include:sendgrid.net
include:mailgun.org
Values from each provider's setup documentation. Zoho accounts outside the US data centre use their own domain, such as zohomail.eu.
Your own servers
Allow the IP the domain's A record points to, e.g. a cPanel server that sends contact-form mail.
Allow the servers listed in your MX records. Not needed for Google or Microsoft if you selected them above.
Copy these from your newsletter, CRM or helpdesk provider's DNS instructions.
Everything else
Add this TXT record
- Type
- TXT
- Host / Name
- @ (your root domain)
- Value
- v=spf1 include:_spf.google.com ~all
- Each include: can contain further lookups of its own, and they count towards the limit of 10. Check the finished record with an SPF checker after publishing.
DNS lookups counted here: 1 of 10 (not counting lookups inside include: records). Replace any existing v=spf1 record rather than adding a second one.
How SPF works, in one minute
When a server receives a message, it looks at the domain in the envelope sender (the Return-Path), fetches that domain's SPF record from DNS, and checks whether the sending server's IP address is on the list. Each item in the record is a mechanism: ip4 and ip6 list addresses directly, a and mx allow whatever your A or MX records point to, and include pulls in another domain's SPF list, which is how providers such as Google Workspace publish their ranges. The final all says what to do with everything not matched.
Worked example: Google Workspace plus a cPanel website
A small business sends staff mail through Google Workspace, and its WordPress site on shared hosting sends order and form notifications from the same domain. Select Google Workspace and turn on The domain's web server (a). The record becomes v=spf1 a include:_spf.google.com ~all. That costs 2 of the 10 lookups at the top level. If the site later moves to a different host, the a mechanism follows the new IP automatically, which is why it is often preferred to typing the IP for a website.
Staying under 10 lookups
Each marketing, CRM or helpdesk tool you connect usually asks for its own include, and many of them contain several more lookups inside. Remove services you no longer use first. Prefer ip4 ranges for your own fixed servers. If you still go over, ask the provider whether it can send from a subdomain such as mail.example.com with its own SPF record; that keeps the main record small. Avoid ptr: it is slow, unreliable and discouraged by the SPF standard.
Publishing and testing
Add the record as TXT at the root of the domain (often shown as @). In cPanel this is under Domains → Zone Editor → Manage → Add Record. After it has propagated, send a message to a Gmail address, open it, choose Show original, and check that SPF says PASS. Then set up DMARC so receivers know what to do with mail that fails, and read the DNS records guide if TXT and MX records are new to you.
Frequently Asked Questions
Related Guides
More Webmaster Utilities
.htaccess Generator
Apache server directives & HTTPS
Robots.txt Builder
Crawl rules & AI bot blocking
DMARC Record Generator
Spoofing policy & reports
Hosting Calculator
Storage, bandwidth & tier estimates
Meta Tag Generator
Live SERP & OpenGraph card previews
Schema Generator
JSON-LD rich snippet generators