What is a SPF record and how to create one
Have you ever wondered why your emails are ending up in the recipient’s SPAM folder? Have you ever been a victim of a third-party sending emails from your domain without you noticing? Have you noticed that your emails are automatically being flagged as SPAM?
If the answer is yes to one of those questions, then you might not be using SPF records. The SPF technology helps protect your domain from sending SPAM and spam signals while also reducing the chance of your emails being picked up by different SPAM filters.
What is a SPF record?
SPF, short for Sender Policy Framework, is a technology that helps validate and authorize the sender of a given email. The way in which SPF works is by checking whether the domain that the email is being sent from has an active SPF record while also ensuring that it contains the IP address of the sender. To put it short, it checks whether the email has been verified by the domain owner.
If this check fails, then the email could get flagged as SPAM and the email itself will never arrive in the recipient’s inbox.
In reality, the SPF record is actually a plain TXT record stored and located in the domain’s DNS zone, which contains a list of all IP addresses that are verified to send emails from the domain to which the zone applies.
What is the syntax of a SPF record?
As we mentioned earlier, the SPF record is a TXT record in the DNS zone of the domain. Because of this, it requires very specific syntax in order to work correctly.
Here is an example of such a record:
v=spf1 +a +mx +ip4:220.127.116.11 -all
But what does this all mean in simple words? In short, the example can be interpreted as follows - we have told the email recipients that the server, which is verified to send emails from our domain name, has an IP address of 18.104.22.168. Now, if a server with a similar IP address like 22.214.171.124 tries to send an email from the same domain, there is a very high chance that the email will be flagged as SPAM.
But you are probably still wondering what all those other symbols and commands mean. Here’s a basic explanation:
|It indicates that this TXT record is actually an SPF record and it shows the SPF version that is being used. There was another version of SPF, but it was discontinued.
|Validate the email, if the IP address (from which the domain is sent) has an A record to the domain sender.
|Validate the email, if the IP address (from which the domain is sent) has an MX record to the domain sender.
|Validate the email, if the IP address (from which the domain is sent) matches the IP address provided in the record.
|Cancel the email in case of unsuccessful validation.
The last parameter has two more versions:
|Accept the email, but mark it as unreliable, in case of unsuccessful validation.
|Accept the email, in case of unsuccessful validation. Strictly not recommended!
How to create a SPF record for my shared hosting domain?
If you would like to change the record or if you would like to create a new one from scratch, you can follow these steps:
- Log into cPanel
- Go to ‘Domains’ and then select ‘Zone Editor’
- Click ‘Manage’ next to the domain for which you would like to create the record
- You will see all records for your selected domain. If you want to change a SPF record, you have to find it in the list
- If you want to create a new SPF record, click ‘Add Record’ and choose the option to add a TXT record. Fill out the required fields and click ‘Add Record’
How to add or create a SPF record for your VPS-hosted domain
If you want to add or create a SPF record for your cloud VPS, you can simply follow the steps that we mentioned previously. Just remember to substitute the IP address in the example SPF record with the IP of your VPS server. Then follow the steps and create a TXT record for your domain through the DNS zone.
How can I check whether I have created my SPF record correctly?
The easiest way to check whether you have successfully created a SPF record is by using MXToolBox. The tool will automatically check whether the record exists and if it is correct. It will also give you information about which IP addresses are allowed to send emails as well as what actions they can perform.
IMPORTANT: Keep in mind that a SPF record is still a DNS record, meaning that it is cached. Because of this, you need to be aware that it might take up to 48 hours in order for it to be created!
Check your records regularly
It is also important to mention that every time something changes in your infrastructure, you need to ensure that your SPF record is still accurate. If you are using the services of an email hosting provider like Mailchimp and all emails are being sent from your domain, you still need to add their servers into your SPF record.
Additionally, there are also a number of other syntactic structures that can be used when creating a SPF record with some examples being ‘exists’, ‘redirect’ and ‘include’. You can use these extra structures to match your SPF records to different purposes.
You can also contact our support if you encounter any problems while trying to create a SPF record!