4 months ago
Hi,
I hope you’re well. I’m reaching out to ask about the best way to handle a root-domain redirect for a project hosted on Railway.
Our setup is as follows:
- The website is deployed on Railway and served from the www subdomain using a CNAME
- The client’s DNS is managed externally (Azure DNS) and they can only configure A records for the root domain, not CNAMEs.
- This means the root domain (bluedot-network.org) cannot point directly to Railway, because Railway doesn’t accept A-record traffic and requires a CNAME.
Our goal is:
- All root domain traffic (bluedot-network.org) should 301.redirect to the www domain (www.bluedot-network.org),
- while keeping the main site hosted on Railway exactly as-is.
Before we build something external, I wanted to ask what the recommended approach is within the Railway ecosystem.
Specifically:
1. Does Railway offer any mechanism for root-domain redirects or A-record termination?
(Static IP endpoint, redirect service, ALIAS/ANAME support, etc.)
2. If not, is there an officially recommended pattern for handling root-level 301 redirects when the hosting provider only supports CNAMEs?
For example, using a small redirect service hosted elsewhere (Render, Vercel, Fly.io, etc.) that receives A-record traffic and forwards to Railway.
3. Is there any upcoming feature or best practice for this scenario?
We want to use the most stable, Railway-aligned solution possible.
This is quite an urgent matter for us to resolve. We migrated to Railway with the goal of hosting all our projects in one place, and the experience has been fantastic so far. However, this domain limitation is currently a significant blocker. Ideally, we’d prefer to keep everything inside Railway if there’s a supported pattern. If not, we would reluctantly set up a minimal external redirect service as a fallback.
Thanks in advance — any guidance would be hugely appreciated.
Pinned Solution
4 months ago
Unfortunately not, Railway only supports CNAME
The only real recommendation I can make is using a platform that does support root level CNAMEs, other than that anything we do will either need to rely on external solutions or wouldn't be a recommended fix
I don't think so, maybe someday (hopefully) Railway will support buying IPs in which case you could just buy a static IP and assign an A record to that
The recommended way would be to use Cloudflare as a DNS instead, you wouldnt need to migrate the domain - only the name server
If your client does not want to use Cloudflare for whatever reason then unfortunately you'd need to rely on external solutions. The easiest would be using a seperate redirect service where you assign an A record pointing to that service which automatically redirects users to www.bluedot-network.org, like https://redirect.pizza or use your own server as you said
3 Replies
4 months 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!
4 months ago
None of those was particularly helpful as our situation slightly differs
4 months ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open brody • 4 months ago
4 months ago
Unfortunately not, Railway only supports CNAME
The only real recommendation I can make is using a platform that does support root level CNAMEs, other than that anything we do will either need to rely on external solutions or wouldn't be a recommended fix
I don't think so, maybe someday (hopefully) Railway will support buying IPs in which case you could just buy a static IP and assign an A record to that
The recommended way would be to use Cloudflare as a DNS instead, you wouldnt need to migrate the domain - only the name server
If your client does not want to use Cloudflare for whatever reason then unfortunately you'd need to rely on external solutions. The easiest would be using a seperate redirect service where you assign an A record pointing to that service which automatically redirects users to www.bluedot-network.org, like https://redirect.pizza or use your own server as you said
Status changed to Solved dev • 3 months ago