Configuring SPF record for mail server

183 Views Asked by At

I want to configure SPF record for my website. Reason behind this is to use Google service i.e. Having your email in Google Now & all.

What I found from Google is:

Create a TXT record containing this text: v=spf1 include:_spf.google.com ~all

To authorize an additional mail server, add the server's IP address before just
before the ~all argument using the format ip4:address or ip6:address.

Please note I've still not added any SPF record till now to my server. So do I need to two separate records each for My server & Google?

So will it be something like below (ip address is my server's static ip address)?

v=spf1 include:_spf.google.com ip4:1.1.1.1 ~all
1

There are 1 best solutions below

0
On

Assuming you're sending email directly from your website using an on-webserver SMTP server (not using Google or any other service) then that looks correct. You should only have a single SPF record per domain, and that record needs to include directives for all sources of email. So your suggested record looks right, although you probably want to put the ip4:1.1.1.1 before the include:_spf.google.com, since the former is cheaper to evaluate.

So you might want to make it:

v=spf1 ip4:1.1.1.1 include:_spf.google.com ~all