SPF records in cPanel

Overview

Sender Policy Framework (SPF) is a method to prevent SPAM. The protocol is increasingly used and has become the standard method to prevent SPAM on the Internet. An SPF record is a TXT record, which is part of the DNS zone file of a domain. This TXT record specifies which IP addresses and host names may be used for sending emails in the name of the domain. If an SPF record is added to a domain, no further configuration is needed, since anti-spam systems check incoming emails based on SPF. Each domain has at most one SPF record, and it works the same way as an A, MX and CNAME record.


Adding a SPF record in cPanel

  1. Login to your cPanel account
  2. Go to 'Advanced Zone Editor'
  3. Add your record via 'Add a record'
    1. Type: select TXT
    2. Name: Enter your domain name without www, and followed by a dot (for example mydomainexample.com.)
    3. TTL: enter 14400
    4. TXT data: Enter your SPF record (for example "v=spf1 +a +mx include:spf.hoasted.com ~all")
  4. Click 'Add Record'

SPF records cpanel

Examples of correct SPF records

In case your website and email are hosted by Hoasted
Allow to send email from your website via Hoasted mailservers (default recommended):

v=spf1 +a +mx include:spf.hoasted.com ~all


In case your website is hosted by Hoasted and your email is hosted by Google G-suite
Allow to send email from your website via Hoasted mailservers and via the Google mailservers (recommended when using Google for Work):

v=spf1 include:spf.hoasted.com include:_spf.google.com +a +mx ~all


In case your website is hosted by Hoasted and your email is hosted byOffice 365
Allow to send email from your website via srv07.hoasted.com IP address 91.134.171.210 and via the Microsoft mailservers (recommended when using Office 365):

v=spf1 include:spf.hoasted.com include:spf.protection.outlook.com +a +mx ~all

Other examples
Block sending email entirely, preventing the domain from sending email:

v=spf1 -all


Allow MX to send mail from the domain. Block all others:

v=spf1 mx -all


Allow any IPv6 address between 192.168.0.1 and 192.168.255.255 to send mail:

v=spf1 ip4:192.168.0.1/16 -all


Allow any IPv6 address between 1080::8:800:0000:0000 and 1080::8:800:FFFF:FFFF to send mail:

v=spf1 ip6:1080::8:800:200C:417A/96 -all


Allow any IPv6 address between 1080::8:800:0000:0000 and 1080::8:800:FFFF:FFFF to send mail:

v=spf1 ip6:1080::8:800:68.0.3.1/96 -all

How can we help you?

We want you to ask us questions, because we love to help you in accomplishing your goals. We let no questions unanswered, provide you with high speed responses and leave no problem unsolved. What is important to you, is important to us. Shoot us a message and see for yourself.