a month ago
I'm trying to connect my website hosted on railway to my squarespace domain. The TXT connected without issue but the CNAME provided by railway is invalid for squarespace. Squarespace says the name cannot contain @ yet the name provided by railway is @
Pinned Solution
a month ago
I’m able to access the site just fine. Have you tried with an incognito window? Not really sure what the current issue is right now…
Attachments
20 Replies
a month ago
The @ in DNS represents the root (apex) domain, and a standard CNAME record is not valid at the apex per DNS standards. Squarespace does not support CNAME flattening or ALIAS records, so it cannot point a root domain at Railway. You have two options: use a subdomain like www instead (which accepts a normal CNAME), or move your domain's nameservers to a provider that supports CNAME flattening such as Cloudflare, then create the CNAME there. Details and a list of supported providers are at Adding a root domain.
Status changed to Awaiting User Response Railway • about 1 month ago
Status changed to Awaiting Railway Response Railway • about 1 month ago
a month ago
To correct our earlier message, Squarespace does advertise ALIAS records, but our documentation has specifically tested and listed Squarespace among providers whose implementation does not work for pointing a root domain at Railway. The apex domain cannot point at Railway while the zone's nameservers are on Squarespace. Two options: use a subdomain like www instead (which takes an ordinary CNAME) and set up a redirect from the apex to it through Squarespace, or move your domain's nameservers to a provider that supports compatible CNAME flattening such as Cloudflare. Details and supported providers are at Adding a root domain.
Status changed to Awaiting User Response Railway • about 1 month ago
a month ago
So there's no way to connect my hosted website on railway to the squarespace url
Status changed to Awaiting Railway Response Railway • about 1 month ago
Status changed to Awaiting User Response Railway • about 1 month ago
a month ago
because on my Squarespace domains it shows my railways main page as connected
Attachments
Status changed to Awaiting Railway Response Railway • about 1 month ago
a month ago
What Squarespace set up there is an HTTP redirect (forwarding), not a DNS record pointing. It sends visitors from your domain to the .up.railway.app URL, so the address in the browser changes to the Railway one. A proper custom domain setup via the CNAME record would keep your domain visible in the browser bar. Since Squarespace cannot create the required CNAME at the apex, your options remain using a subdomain like www (which accepts a standard CNAME) or moving nameservers to a provider like Cloudflare that supports CNAME flattening, both covered at Adding a root domain.
Status changed to Awaiting User Response Railway • about 1 month ago
a month ago
Squarespace has a add presetup where would I get the verification code from
Attachments
Status changed to Awaiting Railway Response Railway • about 1 month ago
a month ago
Both values are in the custom domain dialog you screenshotted earlier from your Railway service settings. The target hostname is the CNAME value (the .up.railway.app address) and the verification code is the TXT record value. That said, this preset still uses Squarespace's ALIAS implementation, which our testing has found incompatible with Railway apex domains, so it may not succeed even with the correct values entered.
Status changed to Awaiting User Response Railway • about 1 month ago
a month ago
for a moment it showed successful dns connection then said issues
Attachments
Status changed to Awaiting Railway Response Railway • about 1 month ago
a month ago
That brief success was likely Squarespace confirming the preset was saved, not that DNS actually resolved. Our system still shows the CNAME record is not reaching Railway and the certificate cannot issue, which confirms Squarespace's ALIAS implementation is not working for the apex domain as expected. Your two paths forward remain: use the www subdomain (which your screenshots show is already added to your service and appears to be working) or move your nameservers to a provider like Cloudflare that supports CNAME flattening, covered at Adding a root domain.
Status changed to Awaiting User Response Railway • about 1 month ago
a month ago
Can u confirm dns connection because now it's stable at connected
Attachments
Status changed to Awaiting Railway Response Railway • about 1 month ago
a month ago
Our system confirms that the DNS for your apex domain is resolving to our edge, the TLS certificate is valid, and the domain is verified and serving traffic with a 200 response. The connection is working.
Status changed to Awaiting User Response Railway • about 1 month ago
a month ago
So now then why is it not pulling up my railway website but the default currently building page
Status changed to Awaiting Railway Response Railway • about 1 month ago
a month ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • about 1 month ago
a month ago
I’m able to access the site just fine. Have you tried with an incognito window? Not really sure what the current issue is right now…
Attachments
a month ago
wait really? One second
a month ago
Might be just caching, try to use a VPN, or access it from a different device / network
a month ago
OMG TY
cyberfights
I don't understand 
a month ago
Solution
The issue is caused by the difference between a root/apex domain and a subdomain.
For example:
- Root domain: "example.com"
- Subdomain: "www.example.com"
Railway provides a CNAME target such as:
"xxxx.up.railway.app"
However, Squarespace does not allow a CNAME record with "@" (the root domain). This is why trying to configure the Railway CNAME for "example.com" fails. Railway also documents Squarespace as a DNS provider that does not support the required CNAME-flattening/dynamic-ALIAS mechanism for root domains.
Option 1 — Use "www" (simplest solution)
If "www.example.com" is acceptable:
-
In Railway, go to:
"Service → Settings → Networking → Custom Domain"
-
Add:
-
Railway will provide a CNAME and TXT verification record.
-
In Squarespace DNS, add:
Type: CNAME
Name: www
Data:
- Add the TXT record exactly as Railway provides it.
Both the CNAME and TXT record are required by Railway.
After DNS propagation, Railway should verify the domain and automatically provision SSL.
Option 2 — Keep the root domain "example.com"
If the requirement is specifically:
without "www", the clean solution is to move DNS management from Squarespace to Cloudflare.
You do NOT need to transfer the domain itself.
Keep the domain registered at Squarespace, but change its nameservers to the nameservers provided by Cloudflare.
Then configure Cloudflare DNS:
Type: CNAME
Name: @
Target:
Proxy: Proxied
And add Railway's TXT verification record exactly as shown in Railway.
Cloudflare supports CNAME flattening, allowing the CNAME-like configuration to work at the root domain. Railway specifically recommends changing the domain's nameservers to Cloudflare when the existing DNS provider does not support CNAME flattening or dynamic ALIAS records.
If using Cloudflare proxying, Railway recommends Full SSL/TLS rather than Full (Strict).
Important
Do not try to solve this by creating an A record pointing to a Railway IP.
Railway does not publish a static IP for custom-domain routing, and its current documentation explicitly states that A records are not supported for this purpose.
Recommended approach
If the goal is simply to get the website working quickly:
Use "www.example.com" → Squarespace CNAME → Railway.
If the requirement is specifically:
"example.com" → Railway
then:
Squarespace registrar → Cloudflare nameservers → Cloudflare CNAME flattening → Railway.
Status changed to Solved mayori • about 1 month ago