How do I find my server's IP address?

caseyocampo
HOBBY

2 months ago

I want to add an A record to my domain's DNS.

Project ID: 2bc9c54d-9d03-4621-a84d-431be23bd107
Region (if that matters): US East, Verginia, USA

Solved$10 Bounty

4 Replies

2 months ago

Why do you want to add an A record to your DNS?


caseyocampo
HOBBY

2 months ago

To add a redirect for "www.mydomain.com". Currently, my site is only viewable at "https://mydomain.com".


you can add more than one custom domain if you're still looking for www support (which seems unnecesary in modern age)


2 months ago

Or you can redirect to your main domain at the DNS level
It's not recommended to use IPs cause the IP can change between deployments


caseyocampo
HOBBY

2 months ago

I think I need to upgrade to the hobby plan for that. Right now I only have my “example.com” active in Railway and it says I’ve run out of custom domains. I wanted to add “www.example.com” because when users enter “www.example.com” vs “example.com” the website can’t be reached.


caseyocampo
HOBBY

2 months ago

I did try adding a redirect in my Namecheap cPanel but that hasn’t worked 🙃


2 months ago

namecheap's redirect records don't work that way unfortunately
I'm also on namecheap, and I ended up just using [domain-forward.com](domain-forward.com)
its been working pretty nicely thus far


caseyocampo
HOBBY

2 months ago

So your domain is accessible at “www” and the base domain? If so, are there any docs available for setting that up?


2 months ago

It depends on the method you're using

  1. You can do what Thalles suggested and add the www domain to your Railway service too so that it supports both, in this case you can find docs for that here:

  2. You can forward traffic from www to your main domain by using something like a DNS level redirect or [domain-forward.com](domain-forward.com), I don't think Railway has docs for this because this is not strictly related to Railway


caseyocampo
HOBBY

2 months ago

For option 1, it says I've hit the custom domain limit for your plan. I'll try to figure out how to forward traffic in Namecheap. There isn't anything Forward specific in the cPanel options so I'll tinker in the DNS settings. Thank you for your help.

Attachments


2 months ago

Alright, and no problem
good luck 🫡


caseyocampo
HOBBY

2 months ago

UPDATE: I was able to get the redirect to work in Namecheap.

Go to Namecheap Dashboard > Domain List > Manage (next to your domain name)

Scroll to Redirect Domain, then enter "www.yourdomain.com" in Source URL and "https://yourdomain.com" in Destination URL.

Select the green check mark to save changes.

Example in the screenshot as well.


caseyocampo

UPDATE: I was able to get the redirect to work in Namecheap.Go to Namecheap Dashboard > Domain List > Manage (next to your domain name)Scroll to Redirect Domain, then enter "www.yourdomain.com" in Source URL and "https://yourdomain.com" in Destination URL.Select the green check mark to save changes.Example in the screenshot as well.

caseyocampo
HOBBY

2 months ago

Screenshot

Attachments


2 months ago

Are you sure that it's working for you? As per namecheap documentation:

Redirecting with a secure connection (HTTPS) is only possible to a different destination domain (e.g. http://www.domain.tld to https://www.anotherdomain.tld)

Unless you have the Namecheap SSL plugin on cPanel?


caseyocampo
HOBBY

2 months ago

I didn’t have to use the cPanel. There’s a section in the dashboard that has an option to set a redirect. I’ve added a screenshot in the thread.


2 months ago

Yea I saw, though from what I know there is no world where that should work
but I guess if it works for you then alls well that ends well


peter-peter254
HOBBY

2 months ago

Just an extra comment here for anyone looking on a resource on how to add a custom domain. (On a hobby plan).

https://youtu.be/pkXHu7lFQMU?si=hb8k1gjRLrtqSwBA


caseyocampo
HOBBY

2 months ago

It’s the only thing I have set up that would add this behavior. If there’s anything I missed, I will update this thread!


2 months ago

Alright awesome, glad it worked out then


Status changed to Solved brody about 2 months ago


2 months ago

!s


caseyocampo
HOBBY

2 months ago

My friend, it indeed did not work out LOL I tested visiting my site on a friends device and got nothing. After signing up for the Hobby Plan I was able to add another domain for my “www” and all is good now.


2 months ago

Oh perfect, thanks for the update


Status changed to Open dev about 2 months ago


Status changed to Solved dev about 2 months ago


How do I find my server's IP address? - Railway Help Station