Add SPF record for multiple systems in different servers

Aragon S asked:

I have a domain with a published SPF record (v=spf1 a mx ip4:xx.xxx.xxx.25 ~all) for it (e.g: xyz.com)
also this domain has four subdomains:
sub1.xyz.com xx.xxx.xxx.29
sub2.xyz.com xx.xxx.xxx.30
sub3.xyz.com xx.xxx.xxx.31
sub4.xyz.com xx.xxx.xxx.32
and every one of those subs in a different server and different IP, when sending emails from subdomains (let’s say for example [email protected]) the SPF check fails, in this situation should I publish individual SPF for every subdomain or include them in the main SPF record? and if I am supposed to include in the main, this must be done in a mechanism:

"v=spf1 a mx a:sub1.xyz.com a:sub2.xyz.com a:sub3.xyz.com a:sub4.xyz.com ip4:xx.xxx.xxx.25 ~all"

or
include mechanism:

"v=spf1 mx a ip4:xx.xxx.xxx.25 include:sub1.xyz.com include:sub2.xyz.com include:sub3.xyz.com include:sub4.xyz.com ~all"

or
mx mechanism:

"v=spf1 a mx mx:sub1.xyz.com mx:sub2.xyz.com mx:sub3.xyz.com mx:sub4.xyz.com ip4:xx.xxx.xxx.25 ~all
"

My answer:


If the email is actually coming from the subdomain, that subdomain needs its own independent SPF record.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.