Branch subdomain configured via external DNS doesn't work

I’m using an external DNS for my Netlify site. I’m trying to point a subdomain to a branch deploy for my Netlify site with the following configuration:

What I tried

Without a domain alias (Domain managementDomainsCustom domains) I get the following certificate error:

$ wget https://dev.apsistech.io/
ERROR: no certificate subject alternative name matches
	requested host name ‘dev.apsistech.io’.

This error makes sense since the automatically-provisioned Let’s Encrypt certificate doesn’t include the dev.apsistech.io subdomain.

So next, I added the domain alias dev.apsistech.io under Domain managementDomainsCustom domains. The result this time is that the subdomain redirects to the apex domain instead of the branch subdomain.

  • Expected redirection: dev.apsistech,iodev--apsis.netlify.app.
  • Actual redirection: dev.apsistech,ioapsis.netlify.app.

Is there any way to configure this properly so that the subdomain redirects to Netlify’s branch subdomain?

You should not add a branch subdomain under custom domains section in the UI. You’re looking for:

We’ve now extended the SSL from our end.