5

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.

2
  • You may want to change the question title to more accurately describe your question. Perhaps something like "How to format the SPF record". May 20, 2010 at 4:02
  • @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 :) May 20, 2010 at 7:24

3 Answers 3

1

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.

6
  • +1... But I'm still confused. How comes there are "a" and "mx" in your spf TXT record line? May 20, 2010 at 3:06
  • @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/… May 20, 2010 at 3:18
  • so in my case simply quoting fields like this would work? @ 3600 IN TXT "v=spf1" "include:_spf.google.com" "~all" May 20, 2010 at 3:20
  • @Yellow, correct May 20, 2010 at 3:27
  • @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. May 20, 2010 at 3:31
0

You have to set TXT records in your DNS server. In your case you are not running your own DNS server so please read through this URL which might prove helpful http://www.openspf.org/ .More precisely this URL http://www.openspf.org/SPF_Record_Syntax

This URL http://old.openspf.org/wizard.html has a wizard which will actually help your set SPF records.

Once set your TXT record should look like this (domain name and I.P Addresses changed for privacy)

[obadiah@zion ~]$ dig txt exampledomain.co.in

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.2 <<>> txt exampledomain.co.in
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11892
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 0

;; QUESTION SECTION:
;exampledomain.co.in.                 IN      TXT

;; ANSWER SECTION:
exampledomain.co.in.          3600    IN      TXT     "v=spf1 ip4:202.189.54.0/19 ip4:179.152.68.0/19 ip4:58.162.110.66/32 ip4:205.199.74.184/32 ip4:195.95.172.199/31 -all"

;; AUTHORITY SECTION:
exampledomain.co.in.          1327    IN      NS      ns2.exampledomain.co.in.
exampledomain.co.in.          1327    IN      NS      ns1.exampledomain.co.in.

;; Query time: 16 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Thu May 20 08:38:28 2010
;; MSG SIZE  rcvd: 196

[obadiah@zion ~]$

Hope this information helps.

2
  • This doesn't help the op format the SPF record for their zone file, which is what they were asking May 20, 2010 at 3:28
  • @vivekvc: thanks Vivek. This allowed to see that now apparently my TXT correctly propagated. I still need to verify if it is effective and I don't know how to do that yet :-/ May 20, 2010 at 7:25
0

The other option is to edit the zone files by hand if the DNS hosting provider allows for it, usually they don't. It is certainly possible if you are the administrator of your own DNS Server.

I work with India's largest Email Service Provider, and we also provide DNS Service for our clients that ask for that service but we don't provide any back end access to our DNS Server.

Some companies provide a front end to their DNS service and might have an option to add the TXT record also.

You must log in to answer this question.

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