Apply The Right SPF Record Format For Authenticating Emails Sent On Your Doman’s Behalf

Spammers usually trick the users by faking the “sent from” and “reply” addresses. They make their messages look as though originating from a reputable entity. The SPF record helps to weed out such spammers and restricts them from using the organization’s domain to send spam emails. To create an efficient SPF record, one needs to properly understand SPF record format and SPF record syntax.

spf records

Learning About SPF Record Format

An SPF record is published as a TXT record on a DNS (Domain Name System) zone. For generating an SPF record, one can use a robust SPF record generator. While configuring an SPF record, a particular format needs to be followed. Let’s see how the SPF record format looks and why it is crucial to understand the same.

Take the following SPF record example:

v=spf1 a mx -all

An SPF record breakdown will show the distinct components in the above record, such as the version, mechanism, and qualifier.

Version Tag

Every SPF record begins with a version number tag. The above example uses the v=spf1 tag. The version tag enables the user to identify the mailing server and allows the receiving server to check whether the incoming mail is from a valid mail server or not.

spf record generator
spf record example

SPF Mechanisms

The role of “mechanism” comes after the version tag. It is the method for identifying the host(s). Commonly used mechanisms include:

  • all
  • a
  • mx
  • ipv4
  • ipv6
  • ptr
  • include
  • exists

These are the fundamental mechanisms that are commonly used. Brief descriptions of some of the important mechanisms are provided below.

“a” Mechanism

The “a” mechanism indicates which IP addresses have the permission to send emails from the domain.

v=spf1 a mx -all

For example, suppose a user sends an email from IP for the domain “” If the “” contains an “a” record, including IP, then the email will pass.

“mx” Mechanism

The “mx” mechanism has got the list of IP addresses that are acceptable for the domain.

v=spf1 a mx -all

Every domain contains one or more “mx” records that include the list of servers used when relaying email. When the “mx” mechanism is included in the SPF record, it automatically approves the servers present in the “mx” record. Then there is no need to list each server individually.

“include” mechanism

The “include” mechanism is used when there is a need to approve certain hosts outside the administration, such as third parties, by including their SPF record in the SPF entry.

v=spf1 a mx -all

“all” mechanism

The work of the “all” mechanism is to match against everything. It indicates whether the incoming email matches the entries in the SPF record or not.

v=spf1 a mx –all

SPF Qualifiers

The mechanisms are preceded by a qualifier, which indicates whether an IP passes the mechanism or fails it.

  • + (Pass): The “+” qualifier indicates that an IP matches a mechanism.
  • – (Fail): The “-” qualifier indicates that an IP fails to match a mechanism.
  • ~ (SoftFail): The soft fail qualifier means the host domain can accept the email but label it as an SPF failure.
  • ? (Neutral): When the server initiates the SPF records check, if the outcome of neither of the parts comes out to be a pass or a fail, then the neutral qualifier is used.

SPF is a powerful tool to keep malicious intrusions at bay to prevent unauthorized use of the organization’s domain to send out spam and phishing emails. However, one must have proper awareness of the right SPF record format and implement it to create an efficient SPF record. Users may have to follow different methodologies for including the SPF records in their domains for various host providers; for instance, the method would be different for adding GoDaddy SPF records from adding SPF records in Office 365, but the format is universal and follows a similar breakdown for any hosting provider.

spf records check

Join the thousands of organizations that use DuoCircle

Find out how affordable it is for your organization today and be pleasantly surprised.

Interested in our Partner Program for MSPs and VARs? Visit Our MSP Partner Program.

Pin It on Pinterest