hello@wpfoss.com

Free SPF record generator

Tick the services that send email for your domain and get the exact SPF record to publish, with a live count of the DNS lookups it uses. It is made in your browser, so nothing is sent to us or stored.

Only used to show where the record goes.

Who sends email as your domain?

Copy the value from that service's own setup page. One per line or separated by commas. Each one costs at least one lookup.

IPv4 or IPv6 addresses or ranges of servers you run. They cost no lookups.

With DMARC enforcing, ~all is fine: DMARC is what refuses forged mail, and our checker grades it that way. Hard fail adds little and punishes a forgotten sender harder.

TXT value, published at the root of your domain

This counts the lookups in the record itself. Each include can trigger more lookups inside it, so the real total can be higher. Read SPF too many DNS lookups, then test the published record with the SPF checker.

A domain may have only one SPF record. If yours already has one, merge these services into it. Do not add a second record.

Made in your browser. Nothing is sent to WPfoss or stored.

How to use your SPF record

What an SPF record does

An SPF record is a list, published in your DNS, of the servers allowed to send email for your domain. When a message arrives claiming to be from you, the receiving server looks up the list and checks whether the sending server is on it. The generator above writes that list for you, in the format receivers expect.

Work out who really sends your email

The record is only as good as the list. Before you tick anything, write down every service that sends mail as your domain: the mailbox host, your website's contact form, the invoicing or accounting tool, the newsletter service, the helpdesk, and any server you run yourself. A service you forget will fail the check, and its mail may land in spam. A service you no longer use is worse in a quieter way: it spends part of your lookup allowance and keeps a door open to a company you no longer control.

One record only, and the 10 lookup limit

The two rules that break most SPF records are the same two the generator watches. First, only one record is allowed. If you already have one, merge the new services into it and delete the old one, because two records cancel each other out. Second, a receiving server will follow at most 10 DNS lookups. Includes, a, mx, ptr, exists and redirect each count as one, and the services you include can contain their own includes. The meter under the record shows the lookups the record itself uses, so treat it as a minimum. Go over 10 and receivers treat the whole record as an error, which our guide SPF too many DNS lookups explains in full. If you run out, move a sender to a subdomain of its own, which gets its own allowance.

Why some services are missing from the list

A tick box is only added when the service's own current documentation gives the exact include value. Many services do not ask for one at all, because they send from a bounce domain of their own and prove themselves with DKIM instead. Adding an include that a service does not need wastes a lookup and does nothing else. For any service not listed, use the other services box and copy the value from that service's own setup page.

Soft fail or hard fail

The ending decides what receivers do with mail from a server that is not on your list. ~all says treat it as suspicious. -all says refuse it. It matters less than people expect, because SPF checks a hidden sending address, not the name your reader sees. DMARC is what stops forged mail that shows your name, and with an enforcing DMARC policy, ~all is a normal and safe choice. That matches how our own checker grades it.

Where the record goes, and what to do after

Add a TXT record at the root of your domain, which many DNS hosts show as @, with the value from the generator. Then test it with the SPF checker, which counts the lookups inside the includes as well. SPF works best as one of three: read SPF, DKIM and DMARC explained, then make your DMARC record with the DMARC record generator. Start DMARC at none and read the reports before you tighten it. See the three DMARC policies for the order.

Want it done for you? We find every sender, build one clean record and test it: Book a Security Review, or read how we handle domain and email security.

Check the whole domain at once with the domain security checker.

SPF record generator questions

Can I have more than one SPF record?

No. A domain may publish only one SPF record, and two records make receivers treat SPF as broken for every message. If you already have one, merge the new services into it instead of adding a second.

What is the 10 lookup limit?

The SPF standard (RFC 7208) lets a receiving server follow at most 10 DNS lookups while checking a record. Each include, a, mx, ptr, exists and redirect uses one. Addresses written as ip4 or ip6 use none. Go over 10 and the whole record is treated as an error.

Why can the real lookup count be higher than the number shown?

The generator counts the lookups in the record it writes. But every include points to another record, and that record can contain includes of its own. The real total is the visible count plus whatever sits inside those services, so test the published record with the SPF checker.

Should I end with ~all or -all?

~all means mail from other servers is suspicious and -all means it should be refused. If your DMARC policy is enforcing, ~all is fine because DMARC does the refusing, and it is the safer choice while you are still finding every sender. -all makes the most sense once you are sure the list is complete.

Do I add the "mx" and "a" options?

Only if your own mail server or web server actually sends email. If you send through a hosted service such as Google Workspace or Microsoft 365, you do not need them, and each one spends a lookup.

Why is my email service not in the list?

We only list a service when its own current documentation names the exact include value to publish. Many services need no SPF include at all, because they use their own bounce domain. Use the include box for anything else, and copy the value from that service’s setup page.

Does this tool see or store my domain or addresses?

No. The record is built by your own browser. There is no server call, so nothing is sent to WPfoss and nothing is saved.

An SPF record is easy to write and easy to get wrong.

We find every service that sends as your domain, merge them into one record that stays inside the lookup limit, and test it before and after.