如果域名指向一个IP,那么那个域名的cname也会指向那个IP?
If domain name points to an IP, then cname to that domain will also point to that IP?
假设我有一个域 example.com
,它指向一个 IP 111.11.11.1
。
如果我将新域 example2.com
命名为 example.com
.
会不会也指向111.11.11.1
?
根据https://www.cloudflare.com/learning/dns/dns-records/dns-cname-record/,
All CNAME records must point to a domain, never to an IP address. Imagine a scavenger hunt where each clue points to another clue, and the final clue points to the treasure. A domain with a CNAME record is like a clue that can point you to another clue (another domain with a CNAME record) or to the treasure (a domain with an A record).
所以它不会直接指向,把它指向指向IP的域名
CNAME 是别名:它指向另一个域名并将解析别名目标 IP,但您永远不会以明文形式看到 example2.com
指向 111.11.11.1
。
您可以查看例如 rfc1034 以获取更多信息:
For example, suppose a name server was processing a query with for USC-
ISIC.ARPA, asking for type A information, and had the following resource
records:
USC-ISIC.ARPA IN CNAME C.ISI.EDU
C.ISI.EDU IN A 10.0.0.52
Both of these RRs would be returned in the response to the type A query,
while a type CNAME or * query should return just the CNAME.
假设我有一个域 example.com
,它指向一个 IP 111.11.11.1
。
如果我将新域 example2.com
命名为 example.com
.
会不会也指向111.11.11.1
?
根据https://www.cloudflare.com/learning/dns/dns-records/dns-cname-record/,
All CNAME records must point to a domain, never to an IP address. Imagine a scavenger hunt where each clue points to another clue, and the final clue points to the treasure. A domain with a CNAME record is like a clue that can point you to another clue (another domain with a CNAME record) or to the treasure (a domain with an A record).
所以它不会直接指向,把它指向指向IP的域名
CNAME 是别名:它指向另一个域名并将解析别名目标 IP,但您永远不会以明文形式看到 example2.com
指向 111.11.11.1
。
您可以查看例如 rfc1034 以获取更多信息:
For example, suppose a name server was processing a query with for USC-
ISIC.ARPA, asking for type A information, and had the following resource
records:
USC-ISIC.ARPA IN CNAME C.ISI.EDU
C.ISI.EDU IN A 10.0.0.52
Both of these RRs would be returned in the response to the type A query,
while a type CNAME or * query should return just the CNAME.