Using a cname for root/apex DNS zone loses MX records

cname-recorddns-hostingdns-zonedomain-name-systemmediatemple

DNS is hosted with Media Temple – I mentioning this only because I am curious if my logic is wrong or if this is specific to the way the Media Temple front end is translating input from the edit form into the zone file.

MX records point to Google Apps. Three A records point to the web server. Media Temple DNS editor contains 3 fields: name, type, data. The A records are configure as such:

"blank" (literally the field is blank) - A - IP Address of web server 
* (wildcard) - A - IP Address of web server
www - A - IP Address of web server

New website was built on a different host. Each of the above captioned A records was converted into a CNAME record pointing the same 3 "names" (hosts) to ext.squarespace.com.

Mail flow stopped to Google Apps.

My-MacBook-Air:~ me$ dig MX example.com

; <<>> DiG 9.8.3-P1 <<>> MX example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64625
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
 ;example.com.      IN  MX

;; ANSWER SECTION:
example.com.    15680   IN  CNAME   ext.squarespace.com.

;; AUTHORITY SECTION:
squarespace.com.    60  IN  SOA ns1.p06.dynect.net.     domains.squarespace.com. 1101726 3600 600 604800 60

When I removed the blank and * records, the same query returned the expected response (Google Servers). My question is: why does this configuration result in the above captioned response? My logic for the record that resolves example.com. (FQDN) to the web host was to deal with the event that an individual does not include the www prefix.

Best Answer

Your first record ("blank"/apex/root) can, but probably shouldn't, be a cname; see How to overcome root domain CNAME restrictions? on Stack Overflow:

This is often attempted by inexperienced administrators as an obvious way to allow your domain name to also be a host. However, DNS servers like BIND will see the CNAME and refuse to add any other resources for that name. Since no other records are allowed to coexist with a CNAME, the NS entries are ignored. Therefore all the hosts in the podunk.xx domain are ignored as well!

So, in short: If you have a cname as your apex, all bets are off as to whether or not any other records work inside the zone.

See also:

Related Topic