a year ago
Hi,
I need to check the status of each instance and verify their endpoints in real-time.
For example, if each instance has a /status endpoint that returns certain values, and I have instances A and B:
GET https://A/status
GET https://B/status
Can I perform these checks in this way?
Thank you.
23 Replies
a year ago
Hello,
Not through the public network as our public proxy does not expose the ability to access a single specific replica.
But you can over the private network, when you do a DNS lookup for the private domain of a service with multiple replicas we will return a list of IPs for each replica, example -
https://utilities.up.railway.app/dns-lookup?value=hello-world.railway.internal&type=ip
Then you would just need to write some code to call each IP's status endpoint.
Hope this helps!
Brody
Status changed to Awaiting User Response Railway • about 1 year ago
a year ago
Hello!
So, I should retrieve the IPs using the dns-lookup utilities and then get the values from each IP, correct?
I have a question regarding this.
Can I access private IPs from within the same deployment or the same project?
Thank you!
Status changed to Awaiting Railway Response Railway • about 1 year ago
a year ago
Hello!
All you need to do is write some code to do a DNS lookup for your desired service's private domain, then loop through each returned IP to make the needed http request.
You can access the IPs of a private service from any service within the same project, but it wouldn't make much sense for a service to do an HTTP health check on itself.
Best,
Brody
Status changed to Awaiting User Response Railway • about 1 year ago
a year ago
OK, then I need to make a simple service to check the instances of the main service in the same project.
Thank you.
Status changed to Awaiting Railway Response Railway • about 1 year ago
Status changed to Awaiting User Response Railway • about 1 year ago
a year ago
Hello @brody,
I tried the solution you suggested, but unfortunately, it didn’t work. The target service host is myhost.railway.internal, and I tested it from the myhost2 (which is in the same project) using the following URL:
https://utilities.up.railway.app/dns-lookup?value=myhost.railway.internal&type=ip
However, the result I received was:
lookup myhost.railway.internal on [fd12::10]:53: no such host
Am I missing something?
Status changed to Awaiting Railway Response Railway • about 1 year ago
a year ago
Are you making sure to do a AAAA DNS lookup? the private network is IPv6 only, thus you need to a AAAA lookup.
Status changed to Awaiting User Response Railway • about 1 year ago
a year ago
What you mean AAAA DNS lookup? The value ‘myhost.railway.internal’ is from railway settings.
Status changed to Awaiting Railway Response Railway • about 1 year ago
a year ago
Please see Cloudflare's explanation on what a AAAA DNS record is -
https://www.cloudflare.com/learning/dns/dns-records/dns-aaaa-record/
Status changed to Awaiting User Response Railway • about 1 year ago
a year ago
I mean, I use the domain from railway setting(screenshot attached). Couldn’t use this? What can I use a domain for finding internal IPs?
Status changed to Awaiting Railway Response Railway • about 1 year ago
a year ago
That is the correct domain, are you making sure to do a AAAA DNS lookup? the private network is IPv6 only, thus you need to a AAAA lookup for that domain.
Status changed to Awaiting User Response Railway • about 1 year ago
a year ago
Oh no, you're trying to use utilities.up.railway.app -- thats not going to work, you need to write your own code.
a year ago
I use utilities.up.railway.app from your advice.
https://utilities.up.railway.app/dns-lookup?value=hello-world.railway.internal&type=ip
I find the internal domain in there so I use it.. but couldn’t I use that?
Status changed to Awaiting Railway Response Railway • about 1 year ago
a year ago
Oh, OK Thank you 
a year ago
My utilities app does not have access to your private network, it would not be a very private network if it did haha.
Status changed to Awaiting User Response Railway • about 1 year ago
a year ago
I thought it works in the private network because the example has the private domain and when I tried the example, it worked. 
Status changed to Awaiting Railway Response Railway • about 1 year ago
a year ago
Could you make this post private? I haven’t noticed it’s public so I posted some my private informations. I’m sorry.
a year ago
This thread contains great information for people who may have similar questions, and I'm not noticing anything sensitive here, so I will keep it public.
Status changed to Awaiting User Response Railway • about 1 year ago
a year ago
my service informations in here, So could you please delete the pictures? I’m gonna modifying my informations.
Status changed to Awaiting Railway Response Railway • about 1 year ago
a year ago
Your service information is not particularly sensitive information, the private domain is something only you can use.
Status changed to Awaiting User Response Railway • about 1 year ago
a year ago
Yes I know but I don’t want to expose the names. Because the people may infer some kind of private informations.
Status changed to Awaiting Railway Response Railway • about 1 year ago
a year ago
Going to leave this public, nothing sensitive has been shared here!
Private threads are for private matters such as billing issues or reserved for Pro users.
Status changed to Awaiting User Response Railway • about 1 year ago
