大网数据广告活动
服务器运维问答

DNS CNAME Resolution - which IP would be returned?

· 52CE 我爱测

I saw this example of a CNAME record, but I don‘t know what IP would be returned and couldn‘t find an answer. I‘m looking for the IP of pc2.an.example.com and the mail server of an.example.com Zone file example.com : example.com.…

问题原文

原帖链接 · retrok · CC BY-SA 4.0

I saw this example of a CNAME record, but I don‘t know what IP would be returned and couldn‘t find an answer.

I‘m looking for the IP of pc2.an.example.com and the mail server of an.example.com

Zone file example.com:

example.com. IN SOA...

example.com. 1800 IN NS ns1.example.com

an.example.com. 1800 IN NS ns1.an.example.com

ns1.example.com. 1800 IN A 12.34.56.78

ns1.an.example.com. 1800 IN A 123.45.67.1

Zone file an.example.com:

an.example.com. IN SOA...

an.example.com. IN NS ns1.an.example.com

ns1.an.example.com. 1800 IN A 123.45.67.1

an.example.com. MX 10 pc2.an.example.com

pc1.an.example.com. 1800 IN A 123.45.67.2

pc2.an.example.com 1800 IN A 23.45.67.89 

pc2 CNAME pc1.an.example.com.

So which IPs would be returned for pc2 and the mail server? My first idea was that the CNAME would be ignored because pc2 has an „A“ record with a full IP, but I noticed there is no dot at the end of pc2.an.example.com, maybe that has an effect because the adress is relative?

Thanks for any help!

已采纳解答

原帖链接 · Esa Jokinen · CC BY-SA 4.0

You'd get:

an.example.com. IN MX 10 pc2.an.example.com

pc2.an.example.com. IN CNAME pc1.an.example.com.
pc1.an.example.com. IN A 123.45.67.2
  • There can't exists another resourse record like A or AAAA with a CNAME. They'd get ignored.

  • pc2.an.example.com without a dot equals pc2.an.example.com.an.example.com. for which the IN A 23.45.67.89 currently is.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-07-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。