I am a bit confused about the creation of SPF records.
I have my hosting domain: hosting.mydomain.com, this is the hostname of the actual server running postfix etc.
I have configured my DNS like this:
mydomain.com
@ A 1.2.3.4 (mail server IP)
@ MX 10 mail.mydomain.com
@ TXT v=spf1 mx a a:hosting.mydomain.com ~all
hosting A @
mail A 1.2.3.4 (mail server IP)
Now do I need to include the a:hosting.mydomain.com in my SPF record?
And when I have another domain on the same server configured like this:
otherdomain.com
@ A 9.8.7.6 (web server)
@ MX 10 mail.otherdomain.com
@ TXT v=spf1 mx a ~all
mail A 1.2.3.4 (mail server IP)
Does this SPF record need to include a:hosting.mydomain.com
I am running Webmin/Virtualmin but hosting the DNS external. When I send email through the webmail the sender is always hosting.mydomain.com.
Are these SPF records correct?
otherdomain.comwouldn't even need a SPF record then at all? – Roger Far Sep 06 '13 at 05:39Easiest way to say it is: first you'll need to understand what servers will be sending your mail on behalf of you domain. Then in the spf record of that domain you can either specify an domain name of that server or it's ip. If otherdomain.com has the same ip as mydomain.com. Then you record v=spf1 mx a ~all is good, if otherdomain.com has different ip, but does use that mailserver you'd need to include a IP4 or another a:mydomain.com. Also if mx record resolves to A record of mailserver, than you are all set.
– James S. Sep 06 '13 at 05:54otherdomain.com @ TXT v=spf1 mx a a:mydomain.com ~all
This way otherdomain.com allows mail to be send from mydomain's ip (as in A record, as well from it's own ip (a mx mechanism)).
And
– James S. Sep 06 '13 at 05:55