How can I support dynamic custom subdomains (CNAMEs) pointing to my Railway app?
manojnaidu619
PROOP

25 days ago

I’m building a multi-tenant SaaS app, and I need help figuring out how to handle dynamic custom subdomains.

Here’s the situation:

  • My main web app is hosted on a custom domain connected to Railway, for example:

  • I’d like my users to be able to connect their own subdomains to it, like:

    dashboard.customer.com → CNAME → app.myapp.com
    
  • When someone visits dashboard.customer.com, I want Railway to serve the same app (my backend detects the tenant based on the Host header).

Right now, if I try this, I get the “Train has not arrived at the station” message — which I understand means Railway doesn’t recognize the domain until it’s manually added under Settings → Networking → Custom Domains.

That works for testing, but in production this won’t scale. I need a setup where customers can connect their own subdomains automatically (like other SaaS platforms that use wildcard or dynamic domain mapping).

So my questions are:

  1. Does Railway support dynamic custom domains - so any CNAME pointing to my base domain is accepted automatically?

  2. If not, is there an API or programmatic way to register new custom domains from my app when a customer adds theirs?

I’m basically trying to let customers point subdomain.theirdomain.comapp.myapp.com and have it just work, without manually adding every new domain inside Railway.

Thanks so much for any clarification or suggestions!

$30 Bounty

1 Replies

Railway
BOT

25 days ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


Loading...