Multi tenant - custom domain issue

Hi,
I’ve built a multi-tenant app and pointed a wildcard subdomain to the fly’s IP like *.example.com
This allows me to have a new subdomain for each user like first-tenant.example.com.

I’m also offering a custom domain feature in the app and using fly’s API to add new certs everytime user adds a domain in the system.

I then advise them to add a CNAME record pointing from their domain to first-tenant.example.com

Unfortunately, this doesn’t work and I have no idea why. It only works if I give them the fly’s IP address to set as A record and _acme-challenge to add as well.

Please advise :pray:

Thanks!

Would love to get some feedback here :pray:

I mean, the _acme-challenge record is set as optional, but it is required for me to make the domains work.

Does it work for some hostnames?

CNAME flattening does not work from all DNS providers IIRC. Meaning if they set a CNAME on an apex domain (no subdomain), then it might not work. The subject is broached here.

Some providers call that an ALIAS record and it does work.

You’ll probably need special instructions for your users to set A and AAAA records directly when they are using an apex domain.