I have read various blogs that a CNAME cannot coexist with other records that have the same name as the CNAME record.
I have not found a good example explaining the problem.
Here is an example from the blog:
CNAME records cannot coexist with other records that have the same FQDN as the CNAME record because they effectively overwrite all other records with the same FQDN.
For example, a CNAME record FQDN is example.com, and you want to create an A record FQDN example.com. This is not allowed because the A record FQDN is identical to the CNAME record FQDN, rendering the A record purposeless.
I do not find the example clear enough for me to understand the problem.
I am trying to understand what the explanation means.
Imagine I have configured:
| Domain name | TTL | Class | Record type | Value |
|---|---|---|---|---|
| aliasname.example.com | 300 | IN | CNAME | name.example.com |
| name.example.com | 300 | IN | A | 10.0.0.1 |
What happens in such a configuration?
EDIT: I stand corrected by answers that my above example is correct/valid.
Putting an incorrect/invalid configuration below. The above example came from my wrong understanding of text examples lacking table illustrations.
| Domain name | TTL | Class | Record type | Value |
|---|---|---|---|---|
| name.example.com | 300 | IN | CNAME | othername.example.com |
| name.example.com | 300 | IN | A | 10.0.0.1 |
My understanding is that the latter configuration is invalid because according to RFCs the CNAME is used first and the A record is never used.
Am I right regarding the cause of incorrectness of the latter table?
Or in general what happens in the case of the latter configuration?