What is SPF record
An SPF record is a type of Domain Name Service (DNS) record that identifies which mail servers are permitted to send email on behalf of your domain.
The purpose of an SPF record is to prevent spammers from sending messages with forged From addresses at your domain. Recipients can refer to the SPF record to determine whether a message purporting to be from your domain comes from an authorized mail server.
For example, suppose that your domain example.com uses Gmail. You create an SPF record that identifies the G Suite mail servers as the authorized mail servers for your domain. When a recipient’s mail server receives a message from email@example.com, it can check the SPF record for example.com to determine whether it is a valid message. If the message comes from a server other than the G Suite mail servers listed in the SPF record, the recipient’s mail server can reject it as spam.
If your domain does not have an SPF record, some recipient domains may reject messages from your users because they cannot validate that the messages come from an authorized mail server.
Create a SPF record
- Create a TXT record containing this text: v=spf1 include:_spf.google.com ~all
Publishing an SPF record that uses -all instead of ~all provides stricter security, but may result in delivery problems. See Google IP address ranges for details about the addresses for the G Suite mail servers.
To authorize an additional mail server, add the server’s IP address just before the include:_spf.google.com ~all argument using the format ip4:address or ip6:address.
Note: Adding additional IP addresses to your SPF records increases the number of servers that are authorized to send email on your behalf, so use suitable caution when choosing what you add. (See Sender Policy Framework for more details on the SPF format and security considerations.)
- If your registrar also requires a host setting (such as @), see the TXT records for specific domain providers list for specific instructions.
- Save your changes.
Your new SPF record can take up to 48 hours to go into effect, but this usually happens more quickly.
Avoid adding multiple SPF records
Adding more than one SPF record for a domain can cause problems with mail delivery and spam classification. Instead, we recommend using only one SPF record.