Skip to main content

Retrieve local addresses

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2009-04-20

I have 2 ip's on my computer IP1 and IP2.
I would like to retrieve the local addresses of my comuter.
i am using the code:
String[] addresses = InetAddress.getAllByName(InetAddress.getLocalHost().getHostName());
What is the order of the ips in the array 'addresses' ?
Is it random? or is there any order ?
if it does has an order how does it is set?