a year ago
I created a custom domain and other subdomains on 2 environments on railway (staging and production) and added all 3 CNAMES to Cloudflare with Proxy On and Full Mode.
The subdomains worked like a charm but the root domain (@ on CNAME) doesn't work. On Cloudflare there is a little info icon next to it saying: "CNAME records normally can not be on the zone apex. We use CNAME flattening to make it possible." and when I visit the website I see DNS_PROBE_FINISHED_NXDOMAIN
10 Replies
a year ago
I made it work but only a CNAME redirecting to the custom domain (instead of adding a custom domain on railway)
a year ago
You would want to add that domain to your Railway service and then add the given CNAME to Cloudflare.
a year ago
That it what I did initially and it did not want to work. I waited for 2 or 3 hours and it still gave me the same error. I then removed the domain and just created a CNAME to the actual railway domain I had already for the project, waited for like an hour and it finally worked.
a year ago
I would recommend doing it the correct way, otherwise we can't guarantee your domain will work long term.
a year ago
But the correct way doesn't work. I also checked other accounts I have on railway using old projects and realized I also used this method to get the apex domain to work.
a year ago
The steps are the following:
1- Add a custom domain
2- Copy the CNAME record from the popup that shows
3- Go to Cloudflare
4- Add the record.
How slightly can we be wrong?
Other relevant detail: Having the SSL mode as Full or Full Strict (tried both)
a year ago
At a high level those are indeed the steps, but there is lots of places to go wrong.
a year ago
Such as?