How to format and where to put the SPF TXT record?

10,985

Our SPF records look like this:

@ 1800 IN TXT "v=spf1" "a" "mx" "ip4:x.x.x.x" "ptr:example2.org.au" "mx.example.org.au" "ip4:x.x.x.x" "ip4:y.y.y.y" "a:example2.org.au" "+all"

The equivalent text is:

v=spf1 a mx ip4:x.x.x.x ptr:example2.org.au mx.example.org.au ip4:x.x.x.x ip4:y.y.y.y a:example2.org.au +all

So your guestimate record is very close.

Share:
10,985

Related videos on Youtube

YellowSquirrel
Author by

YellowSquirrel

Updated on September 17, 2022

Comments

  • YellowSquirrel
    YellowSquirrel almost 2 years

    EDIT I think I more or less understand the syntax and, anyway, Google is giving, in the link below, the syntax needed.

    My question is really where to put that stuff. Should I quote every field? The whole line? :)

    I've set up Google apps for my domain: I've registered the domain with Google by adding the CNAME Google asked and I've apparently succesfully setup the MX Google mail servers.

    So far I haven't yet a dedicated server: I'm just having a domain at a registrar.

    Now I want to activate SPF and I'm confused. In the following short webpage:

    http://www.google.com/support/a/bin/answer.py?answer=178723

    it is written that I must add a TXT record containing:

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

    Where should I enter this? Should this go in the zone (?) file, like I did for the CNAME and the MX records?

    So far I have something like this:

    @ 10800 IN A 217.42.42.42
    @ 10800 IN MX 5 ASPMX3.GOOGLEMAIL.COM. 
    @ 10800 IN MX 5 ASPMX2.GOOGLEMAIL.COM. 
    @ 10800 IN MX 3 ALT2.ASPMX.L.GOOGLE.COM. 
    @ 10800 IN MX 3 ALT1.ASPMX.L.GOOGLE.COM. 
    @ 10800 IN MX 1 ASPMX.L.GOOGLE.COM. 
    google8a70835987f31e34 10800 IN CNAME google.com. 
    

    Does adding the SPF TXT record mean I should literally have something like that:

    @ 10800 IN A 217.42.42.42
    @ 10800 IN MX 5 ASPMX3.GOOGLEMAIL.COM. 
    @ 10800 IN MX 5 ASPMX2.GOOGLEMAIL.COM.
    @ 3600 IN TXT "v=spf1 include:_spf.google.com ~all" 
    @ 10800 IN MX 3 ALT2.ASPMX.L.GOOGLE.COM. 
    @ 10800 IN MX 3 ALT1.ASPMX.L.GOOGLE.COM. 
    @ 10800 IN MX 1 ASPMX.L.GOOGLE.COM. 
    google8a70835987f31e34 10800 IN CNAME google.com.
    

    I made that one up and included right in the middle to show how confused I am. What I'd like to know is the exact syntax and where/how I should put this TXT record.

    • YellowSquirrel
      YellowSquirrel about 14 years
      @John Gardeniers: I added 'How to format' in the question's title but where to put is still an important part of my question. Actually I think Google gave me an already formatted line and it's just about finding where to put it and how to do the escaping :)
  • MrGigu
    MrGigu about 14 years
    @Yellow, My SPF record is quite complicated because it's authoritave for a few different mail servers and domains. I built it with microsoft.com/mscorp/safety/content/technologies/senderid/…
  • YellowSquirrel
    YellowSquirrel about 14 years
    so in my case simply quoting fields like this would work? @ 3600 IN TXT "v=spf1" "include:_spf.google.com" "~all"
  • MrGigu
    MrGigu about 14 years
    @Yellow, correct
  • MrGigu
    MrGigu about 14 years
    This doesn't help the op format the SPF record for their zone file, which is what they were asking
  • MrGigu
    MrGigu about 14 years
    @yellow, I forgot to mention, you can also quote the whole line, I don't know why our DNS zone file has individual quotes around each string.
  • Baruit
    Baruit over 11 years
    The 'a' means all servers in your A records and the 'mx' means all servers in your MX records. It's basically saying those servers are also valid mailers, invaluable if you're running your own app servers that send email too.