You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/08/18 05:12:27 UTC

[GitHub] [shardingsphere-elasticjob] Technoboy- commented on pull request #1382: [Improvement][common]get the ip configured by hostname first

Technoboy- commented on pull request #1382:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1382#issuecomment-675254029


   On the face of it, InetAddress.getLocalHost() should give you the IP address of this host. The problem is that a host could have lots of network interfaces, and an interface could be bound to more than one IP address. And to top that, not all IP addresses will be reachable outside of your machine or LAN. For example, they could be IP addresses for virtual network devices, private network IP addresses, and so on.
   What this means is that the IP address returned by InetAddress.getLocalHost() might not be the right one to use.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org