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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ