Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

This has been going on for two days now and it's really bugging me.

I've owned a domain name for a few years now. Let's call it I've had Google Apps free edition set up there for a few years and all is good. has an A record pointing at a VPS that I own and MX records pointing at Google. I also have all email from forwarded to my personal gmail account.

Just recently I registered a domain name for my friend's business that he is starting and set him up with Google Apps free edition. Let's called it This domain has MX records pointing at Google and a CNAME pointing at -- I am using virtual hosts on my VPS to determine which page to serve -- basic stuff.

Here's the problem. All email sent to ends up at Would the CNAME cause this? And why would it? I didn't think that CNAME records affect email. There are no filters set up for any email at

In the email headers I see To: Moving up the header I see this out of nowhere:


The only explanation I can think of is the CNAME record pointing from to Can anybody verify this for me or possibly name another reason for this to happen?

share|improve this question
If only there were a domain name specifically reserved for examples... Oh, wait. – Joel Coel Dec 8 '11 at 23:08
As for X-Forwarded, probably it's normal because it google forwards it from your apps to your private gmail. Guess you see it in all messages to – Sandman4 Dec 9 '11 at 1:01

1 Answer 1

up vote 4 down vote accepted

Yes, a CNAME record on takes precedence over any other record on

According to the RFC, no other type of resource record (be it A, MX, or otherwise, except for DNSSEC supporting types SIG, NXT, and KEY) can exist on the same name as a CNAME; a BIND name server won't even load a zone with that kind of conflict present.

share|improve this answer
Well then, I learned something today. I'll just have to update the DNS records (and accept your answer in 9 minutes when ServerFault lets me). – KPthunder Dec 8 '11 at 23:10
@KPthunder Can we edit "incorrectly" to "correctly" in your question now? :-) – ceejayoz Dec 8 '11 at 23:15
@ceejayoz I changed it to "unexpectedly." Is that good enough? :P – KPthunder Dec 8 '11 at 23:18
@Sandman4 I removed the CNAME and changed it to an A record of the same IP address of my VPS and now everything works unlike the last two days. – KPthunder Dec 9 '11 at 3:41
@sandman4: it happens because when a CNAME is encountered the sending SMTP server is at liberty to rewrite the recipient address to the target of the CNAME (i.e. CNAME; is rewriteable to Then happily accepts the mail. But you should never use CNAME at the top-level of a zone anyway: It's not valid (as highlighted above). Use the same IP address if you were doing it for a web server, etc., and manage any future changes. – jrg Mar 22 '13 at 14:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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