We can enable Wildcard subdomains for an account, but here’s some stuff to keep in mind.
There are a few requirements before we’re able to do so:
- Either you have to use Netlify DNS so we can get you a wildcard SSL cert, or you must bring a custom wildcard certificate.
- We can only do this for a site that’s on a paid team (see Netlify Pricing and Plans for details)
- You can’t use domain aliases on the site with Wildcard subdomains enabled, just the bare domain and subdomains under your primary domain. If you try to add a domain alias then it won’t work.
- The primary custom domain for the site, if it is a “site.com+www.site.com” setting in our UI, must be www.site.com and NOT site.com!
Once the wildcard subdomain feature is enabled, you do not need to add new subdomains under the site settings. You’ll will need still need to create DNS records.
This might be a single wildcard DNS record for all subdomains (like a CNAME for
*.example.com pointing to the netlify.app subdomain for the site). Alternatively, you can also create the individual DNS records to add each subdomain (like CNAMEs for
subdomain-b.example.com , etc.) as covered in our external DNS documentation. Both work so please do whichever you prefer.
Please also be aware that we do not current have any built-in method of doing server side “domain-specific” handling - for instance if you want a redirect to automatically redirect from x.yourdomain.com to a path of x based on that subdomain, you’ll have to do that in client-side JS (you can make hostname-specific redirects, but those require the full hostname to be input into each rule, which defeats the zero-config nature of this feature), so please share your use case with us if you are worried about any of the limitations above so you don’t spend time implementing to this feature only to discover limitations that block your use.