'Can we have two subdomains as foo.bar.example.com and *.bar.example.com?

I have two subdomains in amazon route53: *.bar.example.com and foo.bar.example.com and in the backend the two microservices they were hitting was different which we defined in ingress resource rules. When we hit foo.bar.example.com will it redirected to foo.bar service or will it redirect to wildcard service and viceversa?



Solution 1:[1]

The wildcard is only the default value if nothing matches.

See https://en.wikipedia.org/wiki/Wildcard_DNS_record

This wildcard DNS record will cause DNS lookups on domain names ending in example.com that do not exist

(emphasis mine)

PS: there is no "redirection" in the DNS; this is a term existing at the HTTP layer.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Patrick Mevzek