Use this free SPF record generator to authorize every service that sends email for your domain. Pick your providers, add any IPs, and we count the DNS lookups for you.
TXTHost / Name@v=spf1 ~allSelect at least one service or add an IP address. An SPF record with only "all" authorizes no one.
Replace any existing SPF record instead of adding a second one, then verify it with the SPF checker.
Common setups you can copy and adapt
v=spf1 include:_spf.google.com ~allThe most common record for a domain that only sends from Gmail.
v=spf1 include:spf.protection.outlook.com include:sendgrid.net ~allTwo senders in one record. Never publish them as two separate SPF records.
v=spf1 ip4:203.0.113.10 include:mailgun.org -allA static IP costs no DNS lookups. -all rejects everything not listed.
What each part of an SPF record does
v=spf1Required first tag. Marks the TXT record as an SPF record.
include:domainAuthorizes every server in another domain's SPF record, usually your email provider. Costs one lookup plus any inside it.
ip4: / ip6:Authorizes a specific IP address or range. Costs no DNS lookups.
a / mxAuthorizes the servers in your domain's A or MX records. One lookup each.
~allSoft fail for everything not listed. Accepted but marked suspicious.
-allHard fail for everything not listed. Receivers may reject it.
?all / +allNeutral or pass for everyone. Both make SPF useless; avoid them.
SPF allows at most 10 DNS lookups per check. Each include, a, mx, ptr, exists and redirect costs one, and so does everything inside an include. A single provider include can use several lookups on its own, so the limit fills up faster than the record suggests. Past 10, receivers return a permerror and your mail fails SPF.
After publishing, run the SPF checker to confirm the live record is valid.
Everything you need to create a working SPF record
SPF proves who you are. Mailwarm builds the sender reputation that gets your emails into the inbox, with a deliverability audit and an account manager for every customer.