subdomainspf

SPF for subdomain


I need to configure SPF record for a subdomain.

DNS for the main domain (I use Google Mail):

IN MX 1   aspmx.l.google.com.
IN MX 10  aspmx3.googlemail.com.
IN MX 10  aspmx5.googlemail.com.
IN MX 10  aspmx4.googlemail.com.
IN MX 10  aspmx2.googlemail.com.
IN MX 5   alt1.aspmx.l.google.com.
IN MX 5   alt2.aspmx.l.google.com.

IN TXT    "v=spf1 ip4:xx.xxx.xxx.xx include:_spf.google.com ~all"

mysubdomain IN A xxx.xxx.xxx.xxx

But how to set SPF for mysubdomain.example.com ? I will send email newsletter from this subdomain using phpmail.

Also online email checkers show warning that there is no MX record for my subdomain.


Solution

  • Just add the subdomain in front of the SPF record:

    mysubdomain IN TXT    "v=spf1 ip4:xx.xxx.xxx.xx include:_spf.google.com ~all"
    

    Similarly, you can set a separate MX, though you don't necessarily need one if it's the same as for the domain:

    mysubdomain IN MX 1   aspmx.l.google.com.
    mysubdomain IN MX 10  aspmx3.googlemail.com.