What is an SPF record in DNS?

Every 39 seconds, a cyberattack occurs across the world. Therefore, companies need to know what is an SPF record in DNS.

SPF or Sender Policy Framework is an email authentication protocol that only allows specific IP addresses to send emails using a domain name. Any IP address outside of the list will not reach the recipient’s mailbox as it will cause the SPF to fail.

It protects your email domains from hackers to prevent phishing, spam and email spoofing attacks. Email authentication techniques such as SPF are ideal for protecting your email domain. Its structure has 3 main components; mechanism, modifiers and qualifiers.

This blog will discuss what is an SPF record in DNS and more.

What is an SPF record in DNS?

SPF is short for Sender Policy Framework, a DNS TXT record with a list of servers allowed to send emails from a certain domain. It works when domain owners update arbitrary texts in the DNS or Domain Name System to track and regulate respective domain names.

To understand the SPF DNS recordLet’s quickly see what DNS is.

It is a system that translates a computer’s hostname to an IP address on the Internet. All devices connected to the Internet have their IP addresses, which helps other devices locate them.

Now back to the main question, ‘what is an SPF record?.’ For example, if your company uses various sending IP addresses, you can create an inventory of authorized IP addresses in the form of a TXT document called an SPF record to authenticate the authentic IP addresses authorized to use your domain name.

How do SPF records work?

So far we have discussed what is an SPF record in DNS, now it’s time to understand how it works. The authentication process starts once you generate an SPF record for your domain. The return path email address is cross-checked on the recipient side. A return path email address is set in the email header, which defines how to handle bounced emails. It checks whether or not the sending email address is registered in the SPF records.

If the approval is positive, the e-mails are sent to the “inbox”; otherwise it may lead to FPS failure.

SPF record structure and components

SPF DNS record makes your domain credible, trustworthy and, therefore, supports your company’s image. There is a proper SPF record structure that makes it easy to maintain. SPF records have a TXT record type, which is a single text string.

A SPF DNS record starts with the ‘v=’ element, indicating the version used. ‘SPF1’ is the most common version understood by email exchanges. The following terms determine the mechanisms for checking whether or not a domain can send email.


Here are the eight mechanisms

  • EVERYTHING: It always matches. This shows default results like ‘-all’ for unmatched IP addresses.
  • A: The domain name with the A or AAAA address record matches because they can be resolved with the sender address.
  • IP4: The match is successful when the sender is bound to the given IPv4 address range.
  • IP6: The match is successful if the sender belongs to the given IPv6 address range.
  • MX: The sender’s email address is allowed when their domain name consists of an MX record for resolution.
  • RPT: The match is validated when the PTR record is linked to a given domain corresponding to the customer’s address. This is not suggested as it may block all emails sent using your domain.
  • EXIST: It works if the given domain name is validated. This SPF mechanism works with all resolved addresses.
  • TO UNDERSTAND: It refers to other domain policies. So if it passes, it automatically passes. However, if the included policy fails, processing continues.


Modifiers decide SPF DNS record work settings. It consists of pairs of names or values ​​separated by the symbol ‘=’, indicating additional information. They are observed multiple times at the end of the SPF record, and any unrecognized modifiers are ignored in the process.

The ‘redirect’ modifier points to other SPF records responsible for efficient operation. Experts use them whenever multiple domains are linked to the same SPF record. This modifier should be used if a single entity controls all domains, otherwise the ‘include’ modifier is used.


Each mechanism can be combined with one of four qualifiers.

‘+’ for PASS result

‘?’ for a NEUTRAL result interpreted as the NONE policy.

‘~’ for SOFTFAIL. Usually messages that return a SOFTFAIL are accepted but tagged.

‘-‘ for FAIL, the email is rejected.

Why are SPF records used?

Here are the main reasons to know what is an SPF record in DNS and its use.

Prevent cyberattacks

Malicious actors send unauthenticated and fraudulent emails using your domain name to gain the trust of your customers, prospects, stakeholders, etc. They create professional email addresses using your domain to attempt phishing, spamming, email spoofing, and other cyberattacks.

However, if you understand the protocol configuration process and create one for your business, it will be relatively difficult and time-consuming for hackers to exploit your domain. This will eventually reduce the likelihood of falling under their radar.

Improve email deliverability

Domains without SPF DNS records are likely to have their emails bounced or labeled as “spam”. If this persists, the ability to reach the mailbox will be affected. This means that most emails sent using your domain name will not reach the recipient, impacting your business.

DMARC Compliance

DMARC stands for Domain-based Message Authentication, Reporting, and Conformance. This is another email authentication technique that prevents spam, phishing, and email spoofing.

It ensures that only authorized entities can send emails through a specific domain. It is based on SPF verification and DKIM (another email authentication policy) and tells the recipient’s mailbox how to handle each email received from your domain. Based on this, they are marked as “spam”, “rejected” or “delivered normally”.

Additionally, domain administrators can check reports recording their email activity and modify their DMARC policy accordingly. PowerDMARC can make it easier for your company to adopt the DMARC policy by monitoring it and adjusting it regularly as needed.

Final Thoughts

SPF-protected email domains repel malicious actors because it takes extra time and effort to compromise them to attempt malicious activities. SPF syncs with DNS to ensure that only authorized entities can send email from a particular domain.

Otherwise, cyber actors can exploit your brand name by sending fraudulent and spam emails, asking recipients to click on a malicious link, download a corrupted file, or share sensitive information. In many cases, they even request a direct money transfer in your company’s name.

Once you’ve configured your DNS record for SPF, don’t forget to verify it using our free tool FPS Checker tool to test its validity!

Previous How can I make changing DNS as smooth as possible for my customers' emails from home? - Server Configuration - SitePoint Forums
Next Most IPv6 DNS queries sent to Chinese resolvers fail • The Register