All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Alternative to Cloudflare for SaaS for more than 50k custom domains
I have an idea for a project I might actually build in 2026, which would offer users the ability to configure custom domains for their accounts.
Years ago I used to run a blogging platform that I built myself for a couple of years, and I had to do a lot of work to implement custom domains support, which is something I'd rather not have to do again.
I use Cloudflare for a lot of things and I know they now have a product called "Cloudflare for SaaS" which makes it ridiculously easy to add a custom domains feature to a SaaS product, but it supports max 50k domains per account. Beyond that, it's enterprise pricing so I don't know how expensive it would be. Perhaps it would be fine, since already 50k paying customers (the custom domains feature would be a paid only feature) would mean quite a good revenue already, but I am wondering about scalability in the event the product takes off. If it does, 50k is really not a lot of domains.
As an alternative I found https://saascustomdomains.com/ which I had never heard of before, but they claim to support unlimited domains. They cost twice as much as Cloudflare at $0.20 per domain per month, instead of $0.10 (with Cloudflare the first 100 domains are free also).
Have you used any of these or similar products?
For my old project I implemented custom domains with multiple ingress controllers in Kubernetes, and each custom domain had its own ingress resource. In theory I could do that again but scalability would be a problem, because of etcd and the number of objects that would have to be stored in etcd. I have read that Traefik for example can read routes from a relational database instead of using resources stored in etcd, but I don't think Traefik scales much anyway.
I have also read that Caddy can support losts of virtual hosts even on a single machine, but I don't have much experience with it.
In general, I would prefer using something like Cloudflare for SaaS for the simplicity of it, but I am open to suggestions.
Has any of you implemented custom domains support for a SaaS product?


Comments
Caddy will probably work fine, I know of at least one SaaS that uses them for large numbers of virtual hosts. You can configure it to hit an API backend for the virtual host whitelist.
Obviously Caddy and Cloudflare are meant for two very different purposes. If you don’t need L7 DDoS protection or a CDN, then just use Caddy.
Edit: also don’t forget that at that scale you’re gonna need to start worrying about TLS certificates. LE is free yes but they have per-IP rate limits…
You will not have more than 50k domains, I can guarantee you that.
just was curious and read into it, there is AWS Certificate Manager and two article I found about integration:
theory - https://api7.ai/blog/bring-your-own-domain-in-saas
practical - https://dev.to/authress/adding-custom-domains-to-your-saas-4hci
IncogDNS gives unlimited domains for free, with TLS certificates starting at $2.99/month•domain.
It's only accessible through IncogVPN with IncogFox browser.
https://lowendtalk.com/discussion/comment/4673398/#Comment_4673398
Do you know how many by chance? And do they host all of them on a single server?
I would like the easiest option possible because I want to focus on the core idea of the project to validate it asap.
That's also why I am inclined to use something like Cloudflare for SaaS.
Thanks for the first useless comment in the thread
I'll take a look at AWS even though to be honest I would rather not use hyperscalers due to cost.
Please, can we keep the discussion on topic?
I use Cloudflare Enterprise and have ~10 custom SaaS domains but they provide Cloudflare CDN/WAF Enterprise protection for domains not using Cloudflare right now. Nowhere near 50K max domains limit LOL.
I suggest getting a formal quote for Cloudflare Enterprise SaaS to get an idea for pricing as it's tailored to your usage requirements. Then you can budget for when/if you do reach that level of usage.
Can you share how much Enterprise costs?
There's no real set pricing; it's based on your requirements and usage, so it can be anywhere starting between US$5000-10000/month, all the way to 6-digit pricing. There's also different tiers of CF Enterprise so can get confusing.
50K domains for CF SaaS at $0.10/domain for non-Enterprise plans is already running up to $5K/month alone
Gotcha, thanks
If you do reach out to CF sales, prepare a detailed list of all the Cloudflare products/services you want to use/are using and your current usage if you have them. Can help with their quotes.
If you are in the 50k realm*, you get 50% discount with saascustomdomains (per their page), so they look interesting. Thanks for bringing them up.
*) I think 50% discount is applied already on a lower tier like 10k or 15k domains.
Btw as I already have custom subdomains and distribution across nodes solved I might start thinking into custom domains as well (and esp. w/ the rate limits at le as current hurdle). Could be solvable as well.
Oh I missed that, thanks.
just ask them directly, levelsio was doing the same for many AI services and he was getting crazy good quotes back, if they want to sell...
levelsio is amazing, I have been following him for a while
50k is a lot. If you reach that point you'll have plenty of budget and time to find a better solution.
Over-planning and over-engineering are huge pitfalls for any project. Basically another form of procrastination.
Keep it simple, stupid.
You are right, I am probably over-planning it at this stage. But it's a tool I want to succeed so I am afraid of hitting some walls with this later on.
You are planning for a non existing problem. If you have 50k domains then you can figure it out then and you will have the resources to do...
Doing 36K domains with caddy on a single machine (+fail over).
Enterprise is nice but it gets expensive real fast. It's good though and worth the money. At the number you're talking probably worth it although you'd have more control when you manage your own infra.
how do you handle certificates with that many domains?
Caddy handles certs automatically.
I winder about LetsEncrypt rate limits though.
Letsencrypt officially announce ARI which excempt from any rate limit, I don't test though. Certbot 4.1.0+ support it. Everytime your ACME client scan directory recusively, high load would be expected, so you just consider new order limit and directory sharding.
It's handled automatically but spread in batches not to hit the rate limit.
Same for cert renewals, they don't last 100% but renewed in batches before they expire.
@vitobotta Have you check the OpenResty Lua script? I found it is very interesting because you can store all the 50k domains configuration and SSL in a single Redis server. Then, all your proxy servers can share data and SSL with each others. I think it also helps with the LE per IP limit
Oh I didn't know about ARI, thanks.
Gotcha
Actually yes, I have used OpenResty with Lua for the same thing but at a much smaler scale, a while ago. I had forgotten about that option.
Have you tested large number of ingress resources to show that the scalability is a problem? Modern etcd setup can handle a few million objects. BTW ingress API and nginx ingress controller are getting deprecated in favor of gateway API (e.g., implemented by envoy gateway). cert-manager already supports ARI, which is rate-limit exempt for TLS renewals. How about test an envoy gateway + cert-manager setup and report back?
Spot on
Nope, never went above a few 100s
I feel attacked by this comment.