249

I am looking to setup a TXT spf record that has 2 included domains... individually:

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

and

v=spf1 include:otherdomain.com ~all

What is the proper way of combining them into a single item?

1
  • 1
    can anyone tell me what this ?all mean, sometimes they have this sign ~all
    – Tanvir
    Apr 18, 2018 at 12:15

3 Answers 3

369

v=spf1 include:_spf.google.com include:otherdomain.com ~all

There's no restriction against including multiple names in a single entry; Hotmail, for instance, takes this to extremes. Note that multiple includes, or nested ones, need to stay under the limit of 10 total DNS lookups for the whole SPF check.

7
  • 11
    RFC 4408 §10.1: SPF implementations MUST limit the number of mechanisms and modifiers that do DNS lookups to at most 10 per SPF check, including any lookups caused by the use of the "include" mechanism or the "redirect" modifier. Feb 26, 2014 at 10:48
  • 2
    @mr.spuratic Good point - that was poor wording, as I was trying to say "you can do greater than one." Edited. Feb 26, 2014 at 17:49
  • 4
    Do you have to use the word include each time? Would this be a valid format? (minus the fake domain and internal address space) "v=spf1 include:www.domain.com ip4:10.10.10.0/24 ip4:10.10.100.0/24 a -all" I checked it against kitterman.com/spf/validate.html and it said it was valid.
    – k1DBLITZ
    Feb 3, 2015 at 18:20
  • 3
    @k1DBLITZ Yes, that's valid - include is just for when you're using records from another domain. Feb 3, 2015 at 18:21
  • can anyone tell me what this ?all mean, sometimes they have this sign ~all
    – Tanvir
    Apr 18, 2018 at 12:15
1

It look like you can merge both together into one entry. Lenovo.com appears to be an example of this:

v=spf1 include:spf.messagelabs.com include:_netblocks.eloqua.com ~all
4
  • 1
    Their current SPF record is "v=spf1 include:spf.messagelabs.com ~all v=spf1 mx/24 mx:include:ibm.com/24 ~all" Can you explain what you mean?
    – flickerfly
    Mar 7, 2014 at 20:12
  • Perform a "nslookup -type=txt lenovo.com" (without the quotes) and it should be self-explanatory.
    – user48838
    Mar 10, 2014 at 6:09
  • It's as the OP was looking for in a - "spf record that has 2 included domains..."
    – user48838
    Mar 10, 2014 at 6:17
  • 1
    Okay, I thought you meant one include statement like "include:spf.messagelabs.com,include:ibm.com"
    – flickerfly
    Mar 10, 2014 at 12:10
1

You can do this with spacing but use a tool to verify the 10 DNS lookup limit has not been breached. You cannot have multiple SPF records either so you may need to be brutal with the shortlist.

As an aside, you do not need a:foo.com if you have include:foo.com in the same string. If this is is a fallacious remark, please comment below.

You must log in to answer this question.

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