I have a problem with setting the DNS in order to use Google Apps on specific domains. I can easily set the DNS for domains that are controlled via some control panel (eg. GoDaddy) but I have problems for domains that are controlled via zone files on the server.

If I configure the zone file like following:

MYDOMAIN.COM.    3600    IN    SOA    some.domaincontrol.com.    name.mail.com (
; A Records
@    3600    IN    A

; CNAME Records
mail    3600    IN    CNAME    ghs.google.com
calendar    3600    IN    CNAME    ghs.google.com
docs    3600    IN    CNAME    ghs.google.com
www    3600    IN    CNAME    @
test    3600    IN    CNAME    @

; MX Records
@    3600    IN    MX    1    ASPMX.L.GOOGLE.COM
@    3600    IN    MX    5    ALT1.ASPMX.L.GOOGLE.COM
@    3600    IN    MX    5    ALT2.ASPMX.L.GOOGLE.COM
@    3600    IN    MX    10    ASPMX2.GOOGLEMAIL.COM
@    3600    IN    MX    10    ASPMX3.GOOGLEMAIL.COM

; TXT Records
@    3600    IN    TXT    "google-site-verification=blah-blah-12345"

; NS Records
@    3600    IN    NS    some.domaincontrol.com
@    3600    IN    NS    another.domaincontrol.com

Then the MX records reported by Google Apps, and some DNS query sites (like Network Tools), are having as suffix the domain itself:


Also, the "mail", "docs" and "calendar" subdomains are not being redirected to Google Apps.

I have also tried with the following configuration for the MX records, in hope that this will properly point to external (Google) mail exchange:

; MX Records
3600    MX    1    ASPMX.L.GOOGLE.COM.
3600    MX    5    ALT1.ASPMX.L.GOOGLE.COM.
3600    MX    5    ALT2.ASPMX.L.GOOGLE.COM.
3600    MX    10    ASPMX2.GOOGLEMAIL.COM.
3600    MX    10    ASPMX3.GOOGLEMAIL.COM.

But this resulted with no MX record being retrieved by Google Apps and DNS queries. Some sort of misconfiguration in the DNS zone file is occurring

How can I properly configure domain via zone file to properly point to external MX and CNAME lcoations? Particularly to Google Apps?

PS. I have first posted same question at Stackoverflow, prior to realizing that this is more suitable location. Question URL.


In zone files, all domain names without trailing dot interpreted as relative to the zone. @ is a shortcut for the zone domain and if label is omitted, the last label is used. That is probably why in your last MX example you got no MX records.

; CNAME Records
mail     3600    IN    CNAME ghs.google.com.
calendar 3600    IN    CNAME ghs.google.com.
docs     3600    IN    CNAME ghs.google.com.
www      3600    IN    CNAME @
test     3600    IN    CNAME @
; MX Records
@        3600    IN    MX    1    ASPMX.L.GOOGLE.COM.
@        3600    IN    MX    5    ALT1.ASPMX.L.GOOGLE.COM.
@        3600    IN    MX    5    ALT2.ASPMX.L.GOOGLE.COM.
@        3600    IN    MX    10    ASPMX2.GOOGLEMAIL.COM.
@        3600    IN    MX    10    ASPMX3.GOOGLEMAIL.COM.

; TXT Records
@        3600    IN    TXT   "google-site-verification=blah-blah-12345"

; NS Records
@        3600    IN    NS    some.domaincontrol.com.
@        3600    IN    NS    another.domaincontrol.com.
  • it was a missing trailing dot that originally caused problems. I knew it's gonna be something trivial (not to me, of course). now it works like a charm! thanks. – deyo.vuk Apr 29 '12 at 19:21
  • Perfect! Prevents me from having to manually enter in the google mx records every time – Erfan Jun 6 '16 at 6:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.