I have a Linux box using DHCP to get it's IP address.
I am writing a Java program to show the IP address, I used the following code:
myIP = InetAddress.getLocalHost().getHostAddress();
however, the result of the above code is "127.0.0.1" -- brings me no information....
How does the getHostAddress() work? and in what situation it will return a practical IP address instead of the loopback IP?