SPF record generator
Example record
- Name
- @
- Type
- TXT
- Value
v=spf1 mx ~all
- Warning
This is an example record
It allows only the servers that receive your mail, and those often do not send it.
Fix: Add every service and server that sends mail for your domain before you publish it.
- Pass
1 DNS lookup in this record (limit 10)
The record stays within the limit of 10 DNS lookups.
- Pass
~all: other servers soft fail
Mail from servers you did not list soft fails SPF. Receivers usually accept it but treat it as suspect, and your DMARC policy decides the rest.
The record is built on this page, in your browser. Nothing you type here is sent to us.
Check it Once the record is live, the SPF checker reads it from public DNS.
DMARC builds on SPF and DKIM, so a domain that sends mail should publish both. Build the other with the DMARC record generator.
The short answer
This SPF record generator builds the TXT record that lists which servers may send mail for your domain. Add your mail host's include, other sending services and your own IP addresses, choose how receivers treat everything else, and copy the record. It counts the DNS lookups the record makes against the limit of 10.
By The Rasket Team · Last updated
Each field, explained
- Domain
- The domain you send mail from. The record goes at that name, which most DNS hosts call @. Leave it empty and the record is written for @.
- Your mail host's include
- The include: value your mail host asks for. Paste it with or without the include: prefix.
- Other sending services
- Any other service that sends mail as your domain, one include each, separated by spaces, commas or new lines. Each costs a DNS lookup.
- IP addresses and ranges
- Your own servers' IPv4 or IPv6 addresses, with a /prefix for a range. They cost no lookup and are written first. A /0 range is refused.
- This domain's own address sends mail (a)
- Allows the server the domain itself points at. Tick it only if that server sends mail. Costs one lookup.
- The MX hosts send mail (mx)
- Allows the servers that receive your mail. Tick it only if they also send it, which is common for a server you run yourself. Costs one lookup.
- Everything else
- What receivers do with mail from servers you did not list: ~all soft fails it, -all fails it, ?all says nothing. With no sender listed, the record is v=spf1 -all whatever you choose.
- This domain already has an SPF record
- Tick it to be reminded to replace that record with this one. Copy its senders into the form first.
How to read the result
- Pass
- This part of the record is ready to publish.
- Warning
- The record works, but read the note: it may not do what you expect.
- Fail
- Fix this before you publish. Receivers would treat the record as an error, or the entry is left out of it.
- Not checked
- This page looks nothing up, so it cannot count the lookups each include makes. An SPF checker that follows the includes can.
Build an SPF record
- 1Enter your domain. Type the domain you send mail from, like example.com.
- 2Add your senders. Paste your mail host's include, then any other service that sends as your domain and your own servers' IP addresses.
- 3Choose the ending. Keep ~all to start, or pick -all once you are sure every sender is listed.
- 4Publish the record. Copy the value into one TXT record at your domain, replacing any SPF record already there.
- 5Check it. Once it is live, run it through an SPF checker that follows each include and counts every lookup.
Common problems and fixes
| Problem | Why it happens | Fix |
|---|---|---|
| Two SPF records | A record was added for a new service instead of merging it into the one you had. | Keep one record that lists every sender. Two make SPF fail for all your mail. |
| More than 10 DNS lookups | Every include, a and mx costs a lookup, and each include can make more of its own. | Remove services you no longer use, or list a service's IP ranges instead of its include. |
| The record ends in +all or ?all | +all lets any server send as you; ?all tells receivers nothing about other servers. | End with ~all, and move to -all once you are sure every sender is listed. |
| A sender is missing | A new service started sending for your domain without being added to the record. | Add its include or addresses here, publish the new record, and watch your DMARC reports. |
| The record is at the wrong name | It was added at a subdomain such as www, or with the domain typed twice in the name. | Publish it at the domain the mail is sent from: @ at most DNS hosts. |
Frequently asked questions
What is an SPF record?
An SPF record is a TXT record at your domain that lists the servers allowed to send mail for it. Receivers compare the server that delivered a message with that list.
Should my SPF record end with ~all or -all?
~all marks mail from servers you did not list as a soft fail and leaves the decision to your DMARC policy; -all fails it outright. Start with ~all, and move to -all once every sender is listed.
Can a domain have two SPF records?
No. A domain may publish one SPF record. With two, receivers treat SPF as an error and it fails for all your mail, so merge every sender into one record.
What is the 10 lookup limit?
Receivers stop after 10 DNS lookups while checking SPF. Each include, a and mx costs one, plus whatever each include looks up in turn. Past the limit, SPF fails for every message.
Where do I find my mail host's include?
Your mail host's setup page names it, usually as a value that starts with include:. Paste it into the first field as it is; the generator takes the include: prefix off for you.
Is anything I type sent to Rasket?
No. The record is built in your browser as you type. Nothing in the form is sent to us, and our analytics do not record it.
Does an SPF record stop spoofing on its own?
No. SPF checks the return-path domain, which a forger can set to their own. DMARC ties SPF and DKIM to the From address people see, so publish a DMARC record as well.
Sources
2 primary sources, each read on the date shown.
See all sourcesHide sources
- 1.RFC 7208: Sender Policy Framework (SPF) — IETF (April 2014),
- 2.RFC 9989: Domain-Based Message Authentication, Reporting, and Conformance (DMARC) — IETF,
Keep reading
- GlossarySPFSPF is a TXT record listing which servers may send mail for a domain. A receiving server looks up the record for the return path domain and checks whether the machine that connected is on the list. It breaks when a message is forwarded, because the forwarding server is not on your list, and that is why SPF on its own is not enough.
- GlossaryDMARCDMARC tells receiving servers what to do with mail that claims to be from your domain but fails DKIM and SPF. You publish one TXT record naming a policy, none, quarantine or reject, and an address for the reports. It also demands alignment: the domain that passed authentication has to match the one a reader sees in the From header.
- GlossaryDKIMDKIM signs outgoing mail with a private key and publishes the matching public key in DNS, under a label called a selector. A receiving server fetches the key, checks the signature, and learns that the message was not altered on the way and really came from a sender your domain authorized. It survives forwarding, which is why it matters more than SPF alone.
- GlossaryDNS propagation (TTL)Propagation is the delay between publishing a DNS record and the rest of the internet seeing it. Nothing is actually pushed anywhere: resolvers cache the previous answer for as long as its time to live allows, and only ask again when that expires. The old value therefore lingers for up to one TTL, which is why a correct record can look broken for hours.
- ToolDMARC record generatorBuild the DMARC record for your domain: pick a policy, starting with none, set reports and alignment, and copy the exact _dmarc TXT record to publish.
- ToolDKIM checkerCheck the DKIM record for any domain and selector: find the key, follow its CNAME, and see if it is valid, revoked, in testing or too short. Free.
Sending with Rasket? Add your domain and Rasket writes every record it needs, adds them for you at DNS hosts it can connect to, and checks each one until it is live. How domains work in Rasket.