a year ago
Hi team. Our current website is hosted on a non-node.js hosting. I'm working on the new site, which is next js. Thing is, altering cname @ would mess up our email (mail record). Is there a way to only point to root and leave the rest of the records intact?
4 Replies
a year ago
Hey there! We've found the following might help you get unblocked faster:
- 🧵 How can I support dynamic custom subdomains (CNAMEs) pointing to my Railway app?
- 🧵 GoDaddy doesn’t support CNAME @ record – need alternative (A record or CNAME for www)
- 🧵 Custom Domain attachment to Service gives error
- 🧵 Custom Domain Suddenly Stopped Working — CNAME Not Detected Despite Correct DNS Setup
If you find the answer from one of these, please let us know by solving the thread!
a year 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 • about 1 year ago
a month ago
change your mx record to point to a subdomain like mail. and add your mailserver IPs there, then swap the #, i migth be misunderstanding your setup here though.
a month ago
wait does your dns provider support cname flattening?
a month ago
Yes. For the smallest change, attach www.example.com to your Railway service and add the CNAME plus ownership-verification TXT record Railway supplies for that hostname. Leave the apex (@) and existing mail records alone; if your current web host supports HTTP redirects, it can redirect the apex website to www.
If you want the apex itself served by Railway, your DNS provider must support apex CNAME flattening or a dynamic ALIAS/ANAME. Use the Railway-provided target and verification TXT; do not replace MX records with an ordinary apex CNAME. Railway documents this here:
https://docs.railway.com/networking/domains/working-with-domains#adding-a-root-domain
Cloudflare explains why flattening returns IP addresses instead of a conflicting apex CNAME:
https://developers.cloudflare.com/dns/cname-flattening/
Before changing @, check whether mail depends on its address: for example, an MX target of example.com, mail.example.com aliased to @, or an SPF a/a:example.com mechanism. Those dependencies need a mail-provider-approved configuration retaining the actual mail-server address. Keeping MX text unchanged alone would not protect that setup. Preserve DKIM/DMARC and other mail records too.
Which DNS provider do you use, and does your MX target point to a dedicated mail host or back to the apex? Record types and anonymized hostnames are enough; please do not post credentials.
AI-assisted; checked against the linked official documentation. This is a configuration explanation, not a claim that your DNS has been changed.