R
Railway8mo ago
ryanpzr

I need help to add a custom domain

I use Hostinger
59 Replies
Percy
Percy8mo ago
Project ID: a9395b84-5fc0-471d-aade-9f1879cab0ce
ryanpzr
ryanpzr8mo ago
a9395b84-5fc0-471d-aade-9f1879cab0ce
Fragly
Fragly8mo ago
Just pop your custom domain in the deployment settings, it'll ask you to add a CNAME record in your DNS settings, and then you're done
ryanpzr
ryanpzr8mo ago
i dont know the TTL for my custom domain i need to add a TTL in Hostinger
Fragly
Fragly8mo ago
why do you need to add a TTL in hostinger?
ryanpzr
ryanpzr8mo ago
No description
Fragly
Fragly8mo ago
ooh, that's an A record, railway won't ask you to add those, but github will the TTL doesn't really matter tooo much anyway Railway will ask you to add a CNAME record
ryanpzr
ryanpzr8mo ago
Yes yes, this is only example... When i add a CNAME in hostinger, is added as an "ALIAS" I don't know if this is a problem
Fragly
Fragly8mo ago
Nah that's fine, a CNAME record is basically just an alias pointing towards a different domain
Brody
Brody8mo ago
no it's not
Fragly
Fragly8mo ago
<:mommy_confused:1023749002069540935> it's not?
ryanpzr
ryanpzr8mo ago
Can it take a while to be added?
Brody
Brody8mo ago
an alias record is not a substitute for a cname
Fragly
Fragly8mo ago
takes a few seconds normally but can take up to a few minutes to a possibly a few days
ryanpzr
ryanpzr8mo ago
Ok
Brody
Brody8mo ago
fragly they need to use cloudflare's nameservers, I'll leave the help up to you though
Fragly
Fragly8mo ago
Nah, I didn't mean to say it's the same as an alias record My bad, If I'm doing something wrong then feel free to correct me
Brody
Brody8mo ago
hostinger doesn't support root level cnames
ryanpzr
ryanpzr8mo ago
Can i send a screenshot for you? to my problem i need to delete the default CNAME?
Brody
Brody8mo ago
you need to use cloudflare's nameservers fragly, take over for me please
Fragly
Fragly8mo ago
ooh okay, my bad, I just assumed hostinger worked like any other hosting service
ryanpzr
ryanpzr8mo ago
i dont need to add a CNAME in Hostinger?
Fragly
Fragly8mo ago
If I understand correctly then you can't add a CNAME directly in hotinger so you'd need to do it through cloudflare's nameservers To do that, just go to cloudflare's website, set up an account add your domain in cloudflare, it'll then give you instructions on how to add the cloudflare nameservers to hostinger and then you should be able to add a cname record n cloudflare after setting it up in your DNS settings
ryanpzr
ryanpzr8mo ago
Ok, I will do this
Brody
Brody8mo ago
fragly, for future reference, I only know of 3 nameservers that support root level cnames. cloudflare, namecheap, dnsimple. anything other than those 3 and it's plenty safe to assume they need to use cloudflare
Fragly
Fragly8mo ago
thanks brody! I'll keep that in mind
Brody
Brody8mo ago
though all nameservers support cnames on subdomains, it's only a problem with cnames at the root and ryanpzr, you don't need to transfer the domain, you only need to use cloudflare's nameservers
ryanpzr
ryanpzr8mo ago
and I configure it directly in cloudflare's?
Fragly
Fragly8mo ago
Yea, you can do that here:
No description
ryanpzr
ryanpzr8mo ago
i see this error
No description
Brody
Brody8mo ago
please read the message carefully
ryanpzr
ryanpzr8mo ago
i can delete the default CNAME Ok "an A, AAAA, or CNAME record with that host already exist."
Brody
Brody8mo ago
yes, so delete it lol you will also need to make this change https://docs.railway.app/deploy/exposing-your-app#provider-specific-instructions
ryanpzr
ryanpzr8mo ago
I still can't access the domain
ryanpzr
ryanpzr8mo ago
No description
Brody
Brody8mo ago
send the domain please
ryanpzr
ryanpzr8mo ago
mammacarmela.com.br
Brody
Brody8mo ago
read this please
ryanpzr
ryanpzr8mo ago
I read and executed
ryanpzr
ryanpzr8mo ago
No description
Brody
Brody8mo ago
okay then please wait until railway generates an SSL cert for you
ryanpzr
ryanpzr8mo ago
Do I need to change something in DNS?
Brody
Brody8mo ago
don't think so, just be patient please but for good measure, show me the cloudflare dns settings please
ryanpzr
ryanpzr8mo ago
Ok
ryanpzr
ryanpzr8mo ago
No description
Brody
Brody8mo ago
like both me and fragly have told you, you can't use A values, you need to use a CNAME
ryanpzr
ryanpzr8mo ago
oooh okay bro, thank-you for the help! it worked out!
Brody
Brody8mo ago
show me the new dns settings?
ryanpzr
ryanpzr8mo ago
Yes
ryanpzr
ryanpzr8mo ago
No description
Brody
Brody8mo ago
show me the domains you have in railway now?
ryanpzr
ryanpzr8mo ago
only this
Brody
Brody8mo ago
you would need to add the www subdomain to railway as well, otherwise you will get SSL errors for that too
ryanpzr
ryanpzr8mo ago
Thanks, I'll add
ryanpzr
ryanpzr8mo ago
No description
ryanpzr
ryanpzr8mo ago
that way?
Brody
Brody8mo ago
yep!
ryanpzr
ryanpzr8mo ago
Thanks bro!
Brody
Brody8mo ago
no problem