This is more of a network administration problem than an application.
Note that the server (hosting the Java application) is multi-user. it can be three addresses: 1. 99.88.77.66 (public IP) 2. 10.10.10.10 (private, assigned within the country IP)
Which IP address a potential client can access depends on the network configuration.
The client can access the public IP address, but it will gain access to your IP address due to NAT. Another example would be your client IP address 192.168.10.10 through NAT, it gains access to the IP address 10.10.10.10.
You cannot calculate the correct IP address (for publishing your service) using any type of prefix mapping.
You mentioned that this is a corporate solution, and complex network configuration is common in such an environment.
In DNS, the DNS server can be myapp.company.com. It depends on the DNS object to resolve the correct IP address for the client. You may need to coordinate with a network guy with proper DNS support, the solution should be trivial and more reliable.
source share