private static String findAutoHostname() {
try {
Enumeration<NetworkInterface> interfaces = NetworkInterface
.getNetworkInterfaces();
while (interfaces.hasMoreElements()) {
NetworkInterface nwInterface = interfaces.nextElement();
if (!nwInterface.isUp() || nwInterface.isLoopback()
|| nwInterface.isVirtual()) {
continue;
}
Enumeration<InetAddress> addresses = nwInterface
.getInetAddresses();
while (addresses.hasMoreElements()) {
InetAddress address = addresses.nextElement();
if (address.isLoopbackAddress()) {
continue;