SPF Record

Gmail has started bouncing my order confirmation emails so I need to start using some of the anti-spam indicators. One of them is an SPF record. Since I use Linode, there is a tab that lets me create the record. Deciding what to put in it is a bit complicated, but not too bad.

You can create a very simple SPF record or more detailed. I chose to get a little detailed in hopes that it would satisfy Google. You can find details of all the parameters at OpenSPF or Wikipedia.

The simplest record just says to allow all mail from the domain if there is a mail record in the DNS.


example.com  text = "v=spf1 mx ~all"

To see what an SPF record looks like, open the terminal and type the following


nslookup -type=txt Google.com

Your response should look like this:


google.com  text = "v=spf1 include:_spf.google.com ip4:216.73.93.70/31 ip4:216.73.93.72/31 ~all"

If you are using a Linode VPS, mail is sent using IPV6 so you also need an ip6 record. Linode itself uses MailChimp, so their SPF record is:


linode.com  text = "v=spf1 mx include:servers.mcsv.net ~all"

In my case, I set up my SPF record to include charter.net, since I also mail from the office and both my IPV4 and IPV6 address. In the Linode control panel, the data between the quotes is pasted into the form and Linode takes care of creating the record.