How to create an SPF TXT record?
List all IP addresses that are used to send emails on your behalf.
SPF enables you to authenticate your email and to specify which IP addresses are allowed to send an email on your behalf. To implement SPF perfectly, you must first determine which mail servers are used to send emails as your domain. You should consider your Email Service Provider, Office mail server, and any other third-party mail servers that may be used to send an email on your behalf as these mail servers.
Create your SPF record.
- Always start with the version. An SPF record should always start with the version number v=spf1 (version 1). This tag defines the record as SPF.
- After adding the version number, add all IP addresses that are authorized to send an email on your behalf. For example: v=spf1 ip4:34.24.61.237 ip4:14.14.11.227
- Then, for any third-party organization that sends emails on your behalf, you may use an include tag, such as include:newdomain.com. This tag indicates that this third party has been granted permission to send emails on your behalf.
- You should end your record with an all or -all tag once you’ve implemented all IP addresses and include tags. The -all tag is an important aspect of the SPF record since it tells ISPs what policy to use when they find a server that isn’t mentioned in your SPF record. If an unauthorized server sends an email on your behalf, action is done in accordance with the published rules. The -all tag has the following basic types:
- -all (Fail): Servers that aren’t listed in the SPF record are not authorized to send emails, i.e, emails that fail will be rejected.
- ~all (Softfail): If the email is received from a server that isn’t listed, the email will be marked as a soft fail, i.e emails will be accepted but marked.
- +all: It is not recommended to use this option, this tag allows any server to send email from your domain.
Publish the SPF record you just created into your DNS.
You will need to add an SPF record to your DNS. This can be an internal role in your company, or you can ask your DNS provider to publish the record if you have access to a dashboard offered by your DNS provider. To access your DNS manager, follow the following steps:
- Log in to your domain account.
- Find out the page for updating your domain’s DNS records.
- Choose the domain which records you want to change.
- Open the DNS manager.
- Log in to your domain account.
- Create a new TXT record in the TXT (text) section.
- Set the Host field to the name of your domain.
- Fill your SPF record in the TXT Value field.
- Specify the Time To Live (TTL). (Optional)
- Click Save or Add Record to publish the SPF TXT record into your DNS.
Test your SPF record.
Setting up an SPF record is an important aspect of your technical configuration. After setting up your record, validate it or use our SPF record Checker to test it directly.