3

I am trying to point a subdomain to a different server. The A Record changed without issue but the CNAME won't save in cPanel.

I get this error:

Error: sub.domain.com. already has a A record. You may not mix CNAME records with other records for the same name.

How do I fix this?

1
  • 2
    If you are setting the A record to the other server's IP address, what are you trying to set the CNAME record to?
    – MrWhite
    Commented Nov 5, 2020 at 17:41

3 Answers 3

5

A and CNAME both are types of DNS records, that can be applied to a domain name.

But they are mutually exclusive:[1]

  • A resolves a domain name query to an IP address,
  • CNAME resolves it to an other domain name.

So if you are ”trying to point a subdomain to a different server“ it depends on you hosting situation if it's better to have DNS queries resolved directly to the new server's IP by setting the subdomain's A record to the new IP or "redirect" the DNS lookup by setting CNAME to point to a domain name of the new server (which gets DNS-resolved iteratively).[2]

(I certainly have no crystal ball, but person asking the question may confuse a CNAME record to be some kind of alias naming mechanism.)



  1. Actually, a domain name having a CNAME attached must not have any other resource record associated.
  2. NB: In the case of HTTP requests to the mentioned subdomain, the host: header will not change during a CNAME resolution.
2

The error message strongly indicates that you already have an A record for the subdomain.

You need to delete this A record before adding the CNAME record as the 2 record types are incompatible with each other.

1
  • 1
    So if the subdomain host has instructions for adding A records and CNAME records, you only need to do one or the other. You can't do both. Commented Nov 5, 2020 at 10:22
0

To fix this, you will have to login to your Cpanel, then go to Zone Editor (DNS). From there, select the "domain" you are trying to update. Then from the list, there's should option where you can view all "A records" - just delete the "A records" of the sub-domain you have added.

1
  • Not necessarily, perhaps the A Record is the correct one...we don't know for sure.
    – Steve
    Commented May 6, 2021 at 22:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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