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

Can I use nested DNS wildcard records

· 52CE 我爱测

I would like to have multiple dns entries with wildcards such that one entry is nested as subdomain of another CNAME *.example.com -> webserver.example.com CNAME *.api.example.com -> apiserver.example.com The intention being that…

问题原文

原帖链接 · David Turvey · CC BY-SA 4.0

I would like to have multiple dns entries with wildcards such that one entry is nested as subdomain of another

CNAME *.example.com -> webserver.example.com
CNAME *.api.example.com -> apiserver.example.com

The intention being that I can use customer.example.com to access the webserver and customer.api.example.com to access the api server.

Since customer.api.example.com is a valid match for both of the wildcard entries i'm not sure how this will get resolved.

I have tested this on AWS route53 as the DNS provider and it seems to work as expected.customer.api.example.com resolved to the api server. But i'm not sure if this is guaranteed by the DNS spec or was just chance it picked the correct server.

Is this behaviour something I can rely on to be consistent?

已采纳解答

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

This approach is ok, DNS server use the most specific match which is *.api.example.com for customer.api.example.com The behavior should be consistent because is defined in RFC 1034

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

资料来源与适用范围

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

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

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