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
질문됨 일 년 전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
전문가
답변함 일 년 전
profile picture
전문가
검토됨 일 년 전
profile picture
전문가
검토됨 일 년 전
  • 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
전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인