A record and CNAME record for same domain

DrJohnZoidberg

Honorary Master
Joined
Jul 24, 2006
Messages
27,999
Reaction score
7,460
Location
Table View
Have a quick question.

What happens if you have both CNAME and A records for a domain pointing to different locations?

For example:

Code:
www.example.com   A       10.0.0.1
www.example.com   CNAME  www.differentdomaincompletely.com

Will resolution always favour the A record and will this cause issues?
 
It shouldn't be possible to have both A and CNAME.
Trying to create a CNAME record for a domain that already has an A record in DNS should pop up a message saying that a record already exists and won't allow you to create it.

Reason and answer to your question: it will cause issues.
 
It shouldn't be possible to have both A and CNAME.
Trying to create a CNAME record for a domain that already has an A record in DNS should pop up a message saying that a record already exists and won't allow you to create it.

Reason and answer to your question: it will cause issues.

Excellent. Thanks for the answer.
 
From RFC1912 section 2.4, like PsYTraNc3 mentioned:

"A CNAME record is not allowed to coexist with any other data. In other words, if suzy.podunk.xx is an alias for sue.podunk.xx, you can't also have an MX record for suzy.podunk.edu, or an A record, or even a TXT record. [...] DNS servers like BIND will see the CNAME and refuse to add any other resources for that name."
 
From RFC1912 section 2.4, like PsYTraNc3 mentioned:

"A CNAME record is not allowed to coexist with any other data. In other words, if suzy.podunk.xx is an alias for sue.podunk.xx, you can't also have an MX record for suzy.podunk.edu, or an A record, or even a TXT record. [...] DNS servers like BIND will see the CNAME and refuse to add any other resources for that name."

Yep found this out the hard way with a TXT record that refused to reflect... I thought it surely wouldn't do the same with all records but it does!
 
Top
Sign up to the MyBroadband newsletter
X