dns - CNAME 记录中的 * 是否优先于显式子域?

标签 dns cname amazon-route53

我在我的域上定义了一组子域,如下所示:

CNAME sub1.example.com -> sub1.herokuapp.com
CNAME sub2.example.com -> sub2.appspot.com
CNAME www.example.com -> example.herokuapp.com

现在我想添加 CNAME *.example.com -> example.herokuapp.com捕获那些输入太多 WWW 或输入其他缺失子域的人。但会不会*优先于明确定义的子域还是子域会继续按预期工作?

如果它有所作为,我正在使用 Route53。

最佳答案

通配符将只匹配区域中未以其他方式定义的记录。

RFC 1912 ,它提到 MX记录在这里,但同样适用于 CNAME s:

2.7 Wildcard records

Wildcard MXs are useful mostly for non IP-connected sites.  A common
mistake is thinking that a wildcard MX for a zone will apply to all
hosts in the zone.  A wildcard MX will apply only to names in the
zone which aren't listed in the DNS at all.  e.g.,

       podunk.xx.      IN      NS      ns1
                       IN      NS      ns2
       mary            IN      A       1.2.3.4
       *.podunk.xx.    IN      MX      5 sue

Mail for mary.podunk.xx will be sent to itself for delivery.  Only
mail for jane.podunk.xx or any hosts you don't see above will be sent
to the MX.  For most Internet sites, wildcard MX records are not
useful.  You need to put explicit MX records on every host.

关于dns - CNAME 记录中的 * 是否优先于显式子域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14757475/

相关文章:

ssl - 配置错误 : Elastic Load Balancer + EC2 + Route 53

github-pages - 为什么在 github 页面存储库中需要 CNAME 文件,即使我在 DNS 提供商处有 CNAME 记录?

php - cloudflare api 将 curl 转换为 php curl 并发送 CNAME 更新

aws-cloudformation - 公共(public)托管区域 Route53 的日志记录

amazon-web-services - 带有 HTTPS 的 AWS CloudFront 自定义域名不起作用

ssl - 保护具有 cname 记录的 url

mysql - 使用 CodeIgniter Active Record 类按域名扩展名排序

google-app-engine - 如何在 Google App Engine 上设置我的域名?

github - GitHub 项目页面的自定义域

ruby - 从 ruby​​ 中的字符串中删除子域