Route53 only route single level on wildcard subdomain

0

We have a wildcard subdomain pointing at a load balancer, i.e. *.example.com. For a single level domain this is working as expected

However, Route53 will also route second and third level domains. For example, "second.first.example.com" will be routed through the *.example.com record. This is then incompatible with our SSL certificate.

Is there a way to prevent this and only route a single level of subdomain?

Thanks

James
已提问 1 年前1154 查看次数
2 回答
0

Hi.

As of now that is how Route53 handles wildcards, it will route for the subdomain and all the subdomain of the subdomain. However, specific domain names take precedence, so you could create specific records for the domains you don't want to route to the ALB.

From documentation: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html

- The * must replace the entire label. For example, you can't specify *prod.example.com or prod*.example.com.

- Specific domain names take precedence. For example, if you create records for *.example.com and acme.example.com, Route 53 always responds to DNS queries for acme.example.com with the values in the acme.example.com record.

- The * applies to DNS queries for the subdomain level that includes the asterisk, and all the subdomains of that subdomain. For example, if you create a record named *.example.com, Route 53 uses the values in that record to respond to DNS queries for zenith.example.com, acme.zenith.example.com, and pinnacle.acme.zenith.example.com (if there are no records of any type for that hosted zone).
profile picture
专家
已回答 1 年前
profile picture
专家
已审核 1 年前
profile picture
专家
已审核 1 年前
  • Plus on your ALB rules you could use a rule for host-header to limit what domains you will route to a target

0

Hi.Wildcard DNS domains are typically used to handle requests for non-existent domains or subdomains, and while the method shown by JimmyDQV seems valid all FQDNs you do not want routed must be explicitly specified. If this is not acceptable, you should consider whether the use of wildcard DNS domains is appropriate in the first place.

profile picture
专家
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则