Is stage.*.example.com valid for a wildcard DNS CNAME?

Linkadvitch asked:

We are creating a web app that will have vanity subdomains such as user1.example.com. Since we’ll have many subdomains, they need to be dynamic. We want to have a public “stage” area where we can test before going live. The requirement states that all dns names start with stage.

I’m using an AWS load balancer so I have to use a CNAME. Research on google and here tell me that wildcards are supported in DNS CNAME entries (except perhaps when using godaddy) but I haven’t yet convinced myself that you can have a wildcard in the middle of an entry.

Is stage.*.example.com valid for a wildcard DNS CNAME and would it work as I’d expect?

Thanks!

My answer:


The wildcard (the *) must be the leftmost part of the domain. So you can’t do stage.*.example.com.

If you need to do wildcard DNS for this, I suggest using *.stage.example.com. This may require some minor changes to your deployment processes, but should not be significant.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.