问题原文
原帖链接 · Henry · CC BY-SA 4.0
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?
社区高分解答
原帖链接 · x a · CC BY-SA 4.0
A and CNAME both are types of DNS records, that can be applied to a domain name.
But they are mutually exclusive:[1]
Aresolves a domain name query to an IP address,CNAMEresolves 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.)
- Actually, a domain name having a
CNAMEattached must not have any other resource record associated. - NB: In the case of HTTP requests to the mentioned subdomain, the
host:header will not change during aCNAMEresolution.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
