Productivity

SPF Records Explained: Stop Your Business Email Going to Spam

SPF is a DNS record that tells receiving mail servers which servers may send email for your domain. Learn what it does, how to write one, and how to avoid common mistakes.

A small computer connected to a network switch with yellow ethernet cables
Photo: Raspberry Pi 4 on a network switch.jpg by RAIL P (RAIL.PHOTOGRAPHY), CC0, via Wikimedia Commons.
Key points
  • SPF is a DNS TXT record listing the servers allowed to send mail for your domain
  • Receiving servers check it to spot forged senders
  • Include every service that sends mail for you, such as your email host and newsletter tool
  • Google says all senders to personal Gmail accounts must set up SPF or DKIM

If you send email from your own domain, such as [email protected], some of it may land in spam or be rejected. One common cause is missing email authentication. SPF is one of the basic building blocks. This guide explains what it is and how to approach it, using Google's Workspace help as the main source.

This is a technical topic. If you are not comfortable editing your domain's DNS records, ask your domain provider or an IT professional. A wrong record can block your own email.

What SPF does

Google's help page says SPF helps prevent your outgoing email from being marked as spam by receiving email servers. You set it up by adding an SPF DNS TXT record to your domain. An SPF record is a line of text that uses special syntax and lists all the servers that send email for your domain. When receiving servers get a message from your domain, they check the SPF record to verify that the message came from an authorised server.

That also makes it harder for scammers to send messages that pretend to come from your domain, which is relevant to phishing. CISA's phishing guidance lists messages designed to look like they come from a trusted organisation as a common pattern. SPF is one of several tools that make forgery harder.

What an SPF record looks like

Google gives this example of an SPF record:

v=spf1 include:_spf.google.com ~all

Reading it from left to right:

  • v=spf1 says this is an SPF record.
  • include:_spf.google.com says that the servers listed by Google's SPF record are authorised to send mail for the domain.
  • ~all tells receiving servers to mark messages as spam if they come from servers that are not listed. Google says it recommends using ~all in your SPF record.

Who needs it

Google's page says that if you send email to personal Gmail accounts, you must set up email authentication to ensure your email is delivered as expected. All senders must set up SPF or DKIM, and bulk senders (more than 5,000 messages daily) must set up SPF, DKIM and DMARC. These rules come from Google's current sender guidelines, so check the page for updates. Other mailbox providers have their own requirements.

The three steps

Google's page lays out the process:

  1. Identify all your email senders. List every service that sends email using your domain: your main mailbox provider, your newsletter service, your invoicing tool, your website's contact form, and your support desk.
  2. Determine your SPF record. Each service gives you an "include" value in its help documentation. Combine them into one record.
  3. Add your SPF record to your domain. In your DNS provider's dashboard, add a TXT record on your domain with the combined text.

Google's page gives one combined record for senders such as Google Workspace plus other services, with each sender added as an include. Follow that pattern rather than creating separate records.

Check whether SPF is already set up

Google's page notes that you may not need to set up SPF if your domain already has it by default, or if you bought your domain from a Google partner when you signed up for Google Workspace. To check, you can use one of the free tools available on the internet that look up a domain's DNS records. Test on a copy of important changes where possible, and note the old value before editing.

Common mistakes

  • Forgetting a sender. Your newsletter tool is not in the record, so its mail fails.
  • Splitting senders across separate records. Google's examples combine all senders in one record.
  • Typos in the syntax. One misplaced character can invalidate the record.
  • Too many includes. Google says an SPF record can have up to 10 include: tags.
  • Leaving it unchanged after you stop using a service. Remove the include for services you no longer use.

SPF is not the whole story

SPF checks the sending server. DKIM adds a digital signature to messages, and DMARC tells receiving servers what to do when checks fail and sends you reports. Google's page lists these three as related. For a small business, a good setup uses all three, following your email provider's instructions. Our security guides explain other ways to protect your accounts, including two-step verification.

Testing

After you add the record, DNS changes can take time to spread. Then:

  • Send a test email to a personal mailbox and check that it arrives in the inbox.
  • Look at the message's headers or "show original" option to see whether SPF passed.
  • Check again after any change in email services.

The short version

SPF is a DNS TXT record that lists who may send mail for your domain. List every sender, combine them into a single record, add it at your DNS provider, and test. For stronger protection, add DKIM and DMARC.

Sources and further reading

  1. Google Workspace Admin Help, Set up SPF
  2. CISA, Recognize and Report Phishing

How this page was made: drafted with the help of an AI writing assistant, then checked against the sources above. Software menus and policies change, so check the linked pages for the current version. Read our editorial policy or report a mistake.

A

A.Agaag
Editor and site owner at ArcClear. ArcClear publishes practical guides on everyday software, devices and online safety, and links to the official documentation behind each claim.