How about using the host name or IP of the machine itself?
InetAddress.getLocalHost().getHostName();
InetAddress.getLocalHost().getAddress();
http://docs.oracle.com/javase/7/docs/api/java/net/InetAddress.html
Note: If the machines in question have multiple network interfaces, I don't think there is any guarantee which interface is returned via these methods.