Adding a Hostinger domain (Custom domain)

markHOBBY

a year ago

I have been trying to add my custom domain to Railway. Hostinger is not allowing me to add a CNAME as instructed by Railway, making my record an ALIAS.

Is there a way to do this using Hostinger? If not, which domain hosting providers works smoothly with Railway?

Solved

3 Replies

a year ago

Unfortunately it's not possible to add a root level CNAME on hostinger, I'd recommend using Cloudflare as a nameserver instead


Status changed to Solved railway[bot] over 1 year ago


frankkodeHOBBY

a month ago

Can you help with instructions on how to use Cloudflare? I tried, but my site is not showing up


Status changed to Open railway[bot] about 1 month ago


a month ago

Sure, I already wrote a full guide about this for another person who wanted to use Cloudflare on a GoDaddy domain, same will apply to any other DNS though so I'll copy and paste it here because it's a lot and I don't think I can explain it better than I already did there.

Chapter 1. Using Cloudflare

Alright, first you'd want to use Cloudflare as your nameserver instead of GoDaddy

that way you can add CNAMEs on your root, which is probably what you want

To do this, you can go to Cloudflare and make an account if you don't have one already

once you made an account, you'll see an option to add a website, you simply add your domain in there

and then cloudflare will ask you to change your GoDaddy nameservers to the nameservers they'll provide

basically all you need to do is go to GoDaddy, find the option that lets you change the name server ( ns ) and set it to the values cloudflare gives you, after that - you're done! Your domain is now using Cloudflare nameservers

Chapter 2. Linking it on Railway

Now that you have your domain on Cloudflare, it'll be very easy to add it on your Railway project. Simply go to the deployment where you want to add your domain, then go to the deployment's settings, then scroll down until you see "+ Custom Domain"

Once you see that option, you can click on it and add your domain.

It'll then give you a CNAME value that you want to add to your domain's DNS settings.

To do this, copy the value, then go back to cloudflare, go to your domain's settings, click "DNS" on the left.

If you followed along correctly, you'll now be on your DNS records page. From there you can click "Add Record", then set Type to CNAME, set the Name to @ ( or the subdomain you're using, example if you're using test.domain.com, then you'll need to add test instead ), and finally paste the value railway gave you into the Target slot.

Now click save.

Finally, go to the SSL/TLS page on the left, click on it and then make sure it's set to Full.

and you're done! Now just wait for Railway to issue your SSL cert, which is fully automatic


Status changed to Solved dev about 1 month ago


Adding a Hostinger domain (Custom domain) - Railway Help Station