SPF Record Generator
Build a valid SPF TXT DNS record for your domain using a guided form. Copy the result directly into your DNS.
Authorised sources
About SPF Records
SPF (Sender Policy Framework) is a DNS TXT record that specifies which mail servers are authorised to send email from your domain. When a receiving server gets an email claiming to be from @example.com, it looks up the SPF record for example.com and checks whether the sending server's IP is listed. This helps prevent spammers from forging your domain as the sender.
SPF mechanisms
ip4:x.x.x.x/ip6:...— Authorises a specific IP address or CIDR rangemx— Authorises the mail servers listed in the domain's MX recordsa— Authorises the IP addresses in the domain's A/AAAA recordsinclude:domain— Imports the SPF record of another domain (used by third-party senders like Google Workspace, Mailchimp, SendGrid)
The all mechanism (the most important part)
-all— Hard fail: reject mail from any server not listed (recommended for strict domains)~all— Soft fail: accept but mark as suspicious (good for initial deployment)?all— Neutral: no policy (provides minimal protection)+all— Pass all: allows anyone to send — never use this
The 10-lookup limit
SPF evaluation is limited to 10 DNS lookups. Each include:, mx, and a mechanism counts as one lookup. Third-party email providers (SendGrid, Mailchimp, HubSpot, Salesforce) each consume one lookup. Exceeding 10 lookups causes a permerror that may result in SPF failure. This tool counts your lookups and warns if you approach the limit.