Branch subdomain with wildcard CNAME

Hi Netlify Support,

I’m using Netlify DNS and have a wildcard CNAME record that points to prod branch site.
* ->
I also have a subdomain called test that points to my test branch site -> test–

In Deploy context, my production branch is prod and I also created branch deploys for my test branch as well.
prod ->
test -> test–

I was hoping would use the build/deploy of test– site. Instead, it seems to pick up the build of site.

This I can confirm, because the API environment variable (in my app source code) I set the value to for production build ( Whereas the same variable is set to for test build (test–

UPDATE: If I visit test– directly, I can see that it is using the correct API environment variable ( Seems like the wildcard CNAME is taking precedence over explicit subdomain test.

So the issue is my branch subdomain is not pointing to the right API server.

Can you please help with what is missing here?


Hi, @sthamm. We are happy to troubleshoot to find out what is happening. However, to do this, we need to know the actual URLs being tested. Would you please let us know what domain name you are using and what branch you expect to be deployed at that domain name?

You can private message (PM) that to one of our support staff and I’ve confirmed that PMs are enabled for your community login. Note, that only one person can see the PM and this will likely mean a slower reply than posting the information publicly. Please feel free to reply to however you prefer though.

Hi, @sthamm. Thanks for PM-ing the site details. For the site in question, branch subdomains are not enabled under: Site Name > Settings > Domain management > Branch subdomains.

Also, the DNS records never control what site is shown. They control which IP address the traffic is sent to but which site is shown for a domain name is controlled at the HTTP level not the DNS level. In other words, this is controlled by the site settings and not the DNS settings.

Would you please at that custom domain for the branch subdomain for this site?

Note, currently other branches are disabled for this site (under Site Name > Settings > Build & deploy > Deploy contexts). You will likely need to enable this branch there as well.

If this doesn’t resolve the issue, please let us know.