Scenario:

How to create a Sender Policy Framework (SPF) Record to Authorise MX Outbound (MX Out) SMTP Servers to send out emails for your domain.

Solution:

Although not essential a SPF record can help make email delivery more reliable for your domain name. It is also a useful tool to help combat and limit backscatter type spam.  The SPF (TXT) DNS record is to comply with the Sender Policy Framework (SPF) anti-spam initiative and it identifies MX Outbound (MX Out) SMTP mail servers as being approved for sending emails from your domain.

To add or amend a SPF record you will need access to the control panel which manages your domain name and DNS (domain name service) records.  Typically a control panel for changing DNS settings is provided by the company you purchased the domain name from.

Example 1 - Amending an existing SPF record

If you already have an SPF record you simply need to include the MX Outbound SPF record by adding include:spf.mxtools.co.uk.

So for example the existing SPF record look like the below.

example.com.  IN  TXT  "v=spf1 a:myserver.example.com ~all"

Then we add the MX Tools SPF record it would look like this.

example.com.  IN  TXT  "v=spf1 a:myserver.example.com include:spf.mxtools.co.uk ~all"

Example 2 - Adding an SPF record

So you don't have a SPF record for your domain and MX Tools is the only outbound SMTP relay agent you are using.  Therefore your SPF record would look like the below.

example.com.  IN  TXT  "v=spf1 include:spf.mxtools.co.uk ~all"

More information

More information on what is a SPF record can be found here.

Breakdown of the SPF record

The breakdown of the record is as follows

 v=spf1 SPF Version 1
 mx The servers specified in MX (Mail eXchange) records for domain are also authorised to send email for the domain
 a:server.example.com The A record (server.example.com) is authorised to send emails for the domain
 ip4:1.2.3.4 The IP4 address is allowed to send emails on behalf of the domain
include:spf.mxtools.co.uk Include the SPF record spf.mxtools.co.uk, which in turn will allow the servers specified in that SPF record to be authorised to send emails for that domain.
all

-all, Is a strict compliance, meaning reject emails unless they are coming from the servers specified in the SPF record

~all, This is a soft fail, meaning emails will be accepted but will be marked as not complaint with the SPF record

?all, Accept emails anyway (Not recommended)

Checking a SPF Record

Use the MXTools SPF Checker to check and validate your SPF record.