What Are SPF Records?

When do I use a SPF record?

SPF records are records which provide a way for outside email servers to check if the email being sent is truly coming from the listed sender. For a time, SPF records were given their own distinct type of DNS record, but they were not widely adopted and so today it is good practice to list the information in a TXT record type. When we refer to “SPF records” in our documentation, we are referring to SPF records listed as a TXT record, not to the deprecated DNS record type.

What SPF records should I use for Gandi Mail and Web Hosting?

Instead of SPF records, add the following TXT records to the DNS records for your domain.

  • For GandiMail:

@ 10800 IN TXT "v=spf1 include:_mailcust.gandi.net ~all"
  • For Web Hosting:

@ 10800 IN TXT "v=spf1 include:_spf.gpaas.net ~all"
  • For GandiMail + Web Hosting:

@ 10800 IN TXT "v=spf1 include:_mailcust.gandi.net include:_spf.gpaas.net ~all"

This Web Hosting record is only used if you plan to send e-mails through your website (via contact form, etc.)

What SPF records should I use if I don’t use Gandi Mail or Web Hosting?

If you use a mail host other than Gandi, you can check with your mail host to find out what SPF records you should use.

You can also create an SPF record that restrict authorization to a particular IP address or a group of IP addresses.

  • For IPv4 addresses:

@ 10800 IN TXT "v=spf1 ip4:192.0.2.0 ~all"
  • For IPv6 addresses:

@ 10800 IN TXT "v=spf1 ip6:2001:0db8:85a3:0000:0000:8a2e:0370:7334 ~all"

For more detailed information about the options available in an SPF record see the detailed description of the standard.