60

Our business email is hosted on Google apps. In addition, our web server may also send email. Currently our SPF record in DNS looks like this:

domain.com.    IN   TXT    "v=spf1 a include:_spf.google.com -all"

This is all fine, however now we've outsourced our email list management to another company and we need to include a second domain with include. So, I'm looking for something like:

domain.com.    IN   TXT    "v=spf1 a include:_spf.google.com include:otherdomain.com -all"

What is the correct syntax for this? Many thanks!

4 Answers 4

105

All SPF mechanisms, including include, can be used multiple times, separated by spaces:

"v=spf1 include:_spf.google.com include:otherdomain.com -all"

Evaluation of include works this way:

  • If the included data returned PASS, then the include itself generates a result (for example, include:foo.bar generates a PASS, but -include:foo.bar generates a FAIL).

  • If the included data returned FAIL or NEUTRAL, then the include does not contribute to the result at all, and processing goes to your next mechanism.

See SPF record syntax and RFC 7208.

(Note that redirect= is not a mechanism but a global modifier, and cannot be repeated this way.)

3
  • found a cool simple site that did it for me.. spf.zone
    – l0ft13
    Jun 12, 2017 at 18:26
  • 1
    The original cuestion includes an a after v=spf1 but the answer doesn't. Is that a typo or does a mean something? Aug 14, 2018 at 12:16
  • 1
    @Gonzalingui The a allows you to use your ip address to send mail for that specific domain.
    – kaiser
    Mar 21, 2019 at 7:40
9

This is the correct syntax you requested

domain.com:    IN   TXT    "v=spf1  include:_spf.google.com include:otherdomain.com -all"
3

Just use the include mechanism to add each service in your SPF record:

v=spf1 a include:_spf.google.com include:otherdomain.com -all

Make sure you don't create multiple SPF records on one domain. If you do, SPF will return PermError.

Also note that you don't exceed the 10 DNS lookup limit of SPF, otherwise SPF will return PermError too.

1

v=spf1 a include:_spf.google.com include:seconddomain.com include:thirddomain.com -all is the correct way

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .