Multi-tenant application - is it possible to have a wildcard domain in Netlify?

PLEASE help us help you by writing a good post!

  • we need to know your netlify site name. Example: gifted-antelope-58b104.netlify.app
  • DNS issues? Tell us the custom domain, tell us the error message! We can’t help if we don’t know your domain.
  • Build problems? Link or paste the FULL build log & build settings screenshot

The better the post - the faster the answer.

My site name is unique-babka-a1f246.netlify.app.
My application works in a multi-tenanted way - we add new tenants to the database and you can then theoretically access their site. For example, say we have a tenant called “org1”, we onboard them and add their org to our database and immediately the app will work if we go to “org1.joshuah.me”. However, in our current setup, we would need to then need to add a DNS entry for that new domain to get it setup.
We want to automate onboarding new users and have it so that as soon as we set up their org via onboarding into the DB, they can go to their URL and it will work.
This (theoretically) could be done with wildcard DNS pointed to the Netlify app (*.joshuah.me) and a wildcard cert. However, I’ve set this up with Netlify DNS and when I go to a tenant that I haven’t manually added to the “domains” in Netlify, I get a “Not Found” response.
Is it possible to do what I am looking to do in Netfliy? I read somewhere it was an option if you pay for it but I spoke to sales and they didn’t seem to know what I was talking about.
Thanks

Hey @joshua9519,

Wildcard subdomains can be activated, but there are a few requirements:

  1. The site must be on a Pro or above team.

  2. The DNS must be managed by Netlify OR you need to bring a custom wildcard SSL certificate.

  3. The site should not have any domain aliases or branch subdomains.

  4. The primary domain of the website should be on the same level as the required wildcard domain. For example:

If you need the wildcard to be *.bar.domain.com where * can be your wildcard subdomain, the primary domain must be www.bar.domain.com (www can be replaced with any string).

  1. You need to configure the DNS for the wildcard subdomain even in case you are using Netlify DNS. You can follow the external DNS configuration for subdomains and add a CNAME entry with * as the hostname or any other value that you want. The value of this DNS entry should be the Netlify site address.

If that sounds like something that would work, please let us know and we’d enable it for your site.

Hi,
Thanks for the reply!
So if I wanted to have a deployment for dev and staging at *.dev.blah.com and *.staging.blah.com as well as prod at *.blah.com I would need 3 Pro or above sites?

Only if the hostnames are on 3 separate teams. Otherwise, if the sites are all on the same team, you’ll only need to upgrade that one team to Pro.

Hope that helps!

That helps a lot thanks Audrey!