What is an SPF Record?

People send over 300 billion emails worldwide daily. For security-conscious users, the Sender Policy Framework (SPF) helps authenticate their emails as they travel across the internet toward recipients’ inboxes.

Here, we’ll examine what an SPF record is, why you need it, and how to set it up in quick, simple steps.

Let’s get to it.

What’s SPF Record?

An SPF record is a DNS record that indicates to mail exchanges the authorized host to send mails for a domain. It detects forged sender addresses during email delivery, thus helping to authenticate emails.

The framework allows the receiving mail server to check during mail deliveries that a mail claiming to come from a specific domain is coming from there. It reads the DNS records for the list of authorized sending hosts and IP addresses.

SPF works better with DMARC to detect forged sender addresses and authenticate sent emails.

Let’s quickly examine how the Sender Policy Framework works. 

How Simple Policy Framework Work

Simple Message Transfer Protocol is an outgoing email protocol that defines how to send emails through email clients. 

It permits any computer to send emails from any source address. Spammers often exploit this to forge sender addresses, making it difficult to trace the message’s source and the spammers’ identities.

Internet domain owners use SPF information in DNS TXT records to specify which computer or IP address they authorized to send mails with envelope-from addresses in that domain. 

So, when a user sends an email that claims to come from that domain, the receiving mail server verifies the domain administrator authorized the IP address in TXT records to send emails before delivering the message to the recipient.

The verifying receiver rejects messages from unauthorized sources.

Why You Need an SPF Record

Implementing SPF records for your domain comes with huge benefits. Let’s quickly look at some of them.

  • It helps prevent emails from going into spam, hence improving your mail deliverability, which is good for your IP address or sender reputation.
  • SPF records could detect forged sender addresses, making SPF-protected domains less attractive to spammers and phishers.
  • Implementing SPF records ensures spam filters catch emails from scammers pretending to represent your company, allowing only legitimate emails from you to go through. 

Setting Up SPF Record for a Domain

SPF records occur as a single string of text, like the example below.

v=spf1 a mx ip4: include:_spf.google.com ~all

Let’s quickly examine how to implement one for a domain.

To get started, log in to your SPanel account— ScalaHosting’s all-in-one management platform. The default login URL is yourdomain.com/spanel.

What is an SPF Record?, Setting Up SPF Record for a Domain

Click DNS Editor under Domains to make changes to your DNS record.

What is an SPF Record?, Setting Up SPF Record for a Domain 2

Choose the domain you want to add the SPF record to.

What is an SPF Record?, Setting Up SPF Record for a Domain 3

Under the ADD A NEW RECORD section, enter your domain name. For example, domain.com in the Name text box.

What is an SPF Record?, Setting Up SPF Record for a Domain 4

Set your TTL value, or you could use the default value.

TTL stands for Time to Live. It’s the amount of time web admins set a packet (DNS information) to exist in a DNS cache before expiration. 

Select TXT as the record type. 

What is an SPF Record?, Setting Up SPF Record for a Domain 5

TXT is a DNS record for storing text-based information related to your domain. 

Now, copy and paste your SPF information in the Value text box and the blue button to add the record to your DNS records.

That’s it.

But let’s quickly go through the things you have to keep in mind while implementing SPF for your domain.

SPF Record Generators

Use these online tools to generate the SPF record for the domain. Use the information for your SPF implementation value.

  • MxToolBox SPF Record Generator
  • DMARC Analyzer SPF Record Generator
  • PowerDMARC SPF Record Generator
  • MailWizz SPF Record Generator
  • ZeroBounce SPF Generator

SPF Implementation Best Practices

The SPF records of one-sixth of the top web domains suck, according to Fraudmarc.

A poorly set up SPF records can adversely impact deliverability. Follow these best practices to make your SPF implementation shine.

  • Set up only one record per domain. Modify the existing record to make new changes instead of creating a new record. You should merge two different records into one.
  • Try to limit the SPF records to 255 characters for a single string.
  • Use TXT DNS record type to implement SPF.
  • If you are using an include mechanism in your record, avoid duplicating the IP addresses and subnets.
  • Avoid using the exists mechanism in your records unless you have advanced knowledge of its usage.
  • Avoid terminating your SPF record in ‘+all.’ It allows the entire internet to send emails on your behalf. 

Note: SPF mechanism defines the authorized IP addresses allowed to send emails; they are: all, include, a, mx, ip4, ip6, exists. The all mechanism matches any IP address, while include allows you to specify the IP addresses to authorize. 

The SPF qualifiers specify how SPF mechanisms handle a match; examples include: 

  • + for pass
  • for fail
  • ~ for soft fail
  • ? for neutral

Wrapping It Up

This article has outlined how to set up SPF records for any domain. Follow the steps and best practices to ensure your emails don’t end up in the spam folders.

Feel free to contact our support team when you need help.

Was this helpful?

What’s your goal today?

1. Find the right Managed VPS solution

If you’re looking for industry-leading speed, ease of use and reliability Try ScalaHosting with an unconditional money-back guarantee.

2. Make your website lighting fast

We guarantee to make your WordPress site load in less than 2 seconds on a managed VPS with ScalaHosting or give your money back. Fill out the form, and we’ll be in touch.

Please enter a valid name
Please enter a valid website
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

3. Streamline your clients’ hosting experience

If you’re a web studio or development agency hosting more than 30 websites, schedule a call with Vlad, our co-founder and CTO, and see how we can deliver unmatched value to both your business and your clients.


Need a custom cluster or professional advice?

Book a meeting and get a free 30-minute consultation with Vlad, co-founder & CTO of Scala Hosting, who will help you select, design and build the right solution - from a single data center cluster to a multi-region & multi-datacenter high availability cluster with hundreds of servers.

Book a free consultation

4. Learn how to grow your website in 2024

An all-star team of SEO and web influencers are sharing their secret knowledge for the first time in years. Learn about the future of SEO, Web Design best practices and the secrets to getting the foundation for your website to thrive. Watch the exclusive webinar.

An Exclusive Insiders Look Behind The SEO and Web Development Curtain


Working in the web hosting industry for over 13 years, Rado has inevitably got some insight into the industry. A digital marketer by education, Rado is always putting himself in the client's shoes, trying to see what's best for THEM first. A man of the fine detail, you can often find him spending 10+ minutes wondering over a missing comma or slightly skewed design.