The reason you cannot have a CNAME (Canonical Name) record and another record with the same name is due to a restriction in the DNS specification.
According to the DNS specification (RFC 1034), when a CNAME record is present for a specific name, it creates an alias or canonical name for that name. The CNAME record essentially redirects the DNS resolution process to another domain name.
However, having another record with the same name, such as an A (Address) record, MX (Mail Exchanger) record, or any other type of record, would create a conflict because the DNS server would not know which record to prioritize or use for DNS resolution.
To avoid such conflicts and to ensure consistency and predictable behavior, the DNS specification prohibits the coexistence of a CNAME record and any other record type for the same name.
When you attempt to set up a CNAME record for a name that already has another record, the DNS server will typically reject the CNAME record or ignore it.
If you require multiple types of records for the same name, you will need to choose an alternative approach. This may involve using different names or subdomains to differentiate the records or reconsidering your DNS design to accommodate the desired functionality.
It's important to note that this restriction is part of the DNS specification to maintain proper DNS functionality and prevent conflicts or inconsistencies in DNS resolution.