What are CNAME
records?
What a CNAME
record does is to define the owner name (the name where the record is added) to be an alias for the name in CNAME
record value (the canonical name, as per the name of the record type).
Note that this definition of being an alias is on the name level, completely disregarding record types.
One implication of the owner name being an alias is that it cannot also have other records, as that would be in direct conflict with it just being an alias for another name.
From the resolver perspective, if you query for A
, the valid options for a response is an A
typed answer if the name was not an alias or a CNAME
typed answer if the name was an alias. Getting both for the same name is not an option (not one that is allowed by the standard and would have defined behavior, anyway).
Then how can my DNS service provider do this?
Assuming that the claim that they allow you to add CNAME
and A
records side by side is true, there is something non-obvious going on with their service.
I would split it into two main options, without knowing more it's not really possible to know which is relevant in your case:
- Their system is not directly using the user input, but one way or another transforming it into something that would be valid. Either they might add one of the conflicting records but not the other (which would mean the UI is kind of bad), alternatively it might have some form of "CNAME flattening" functionality where they do not actually serve the
CNAME
records entered by the user, but rather resolve the relevant records from the canonical name from their end and serve those as if they were directly at the alias name (which is non-standard functionality, but some services have implemented this type of dynamic lookups to "flatten" CNAME
).
- Their system is broken, allowing the user to add inconsistent data that is not allowed in the specs and can be expected to cause strange problems one way or another (either by their service breaking or by their service actually serving inconsistent data that may break things on the resolver side). The user would be shooting themselves in the foot by making use of this type of breakage in their service.