In another article, we discussed the types of records that can be added to DNS. In this article, we will focus on SPF (Sender Policy Framework) records, which you will need to configure if you have an email service running.
What is an SPF record?
This record is a standard that protects against email address spoofing. It uses domain names (DNS) to identify the mail servers authorized to transport messages. In this way, using SPF improves our sender reputation and also curbs SPAM that impersonates us when sending emails.
How is it configured?
We need to add this record to our domain's DNS zone. We normally configure it using a TXT record, and it usually has this structure:
v=spf1 mx a ip4:222.222.222.222 ~allEach value means the following:
- v: Defines the SPF version used.
- a: The domain's DNS A record.
- ip4: IP address, usually our server.
- ~all: We deny authorization to machines that do not match what is explicitly authorized.
- -all: All mail servers not listed in the SPF record are not explicitly authorized to send email using the sender's domain.
- ~all: All mail servers not listed in the SPF record are not authorized to send email using the sender's domain.
- ?all: The domain controller cannot or does not wish to state whether all mail servers not listed in the SPF record are authorized to send email using the sender's domain.
- +all: All mail servers are authorized to send email on behalf of the sender's domain.
Examples of SPF records
For example, if we want to allow the servers listed as MX to send email for this server, we need to add the mx parameter:
v=spf1 mx ip4:222.222.222.222 ~allIf we want to allow the domain's primary IP address to send email for this domain, you need to add the a parameter:
v=spf1 mx a ip4:222.222.222.222 ~allIf we also want to allow any other server name to send email for this domain:
v=spf1 mx a ip4:222.222.222.222 a:dominio.com ~allAnd finally, if we want to allow any domain to send email for a domain:
v=spf1 mx a ip4:222.222.222.222 a:dominio.com include:dominio.es ~allAdd an SPF record to Clouding DNS
If we sign in to the Clouding.io control panel with our account, we can access DNS:
Click the domain you want to add an SPF record to:
Finally, add the record by clicking Submit, and our SPF record is now added: