public static String getLocalHostName() {
		String hostName = null;
		try {
			hostName = InetAddress.getLocalHost().getHostName();
		} catch (Exception e) {
			LOGGER.error("Error while get localhost name", e);
		}
		if (hostName != null && !"localhost".equals(hostName)) {
			return hostName;
		}
		return getLocalHostName("www.google.com", 80);

	}
Get local host name. On some platform, InetAddress.getLocalHost().getHostName() will return
"localhost". If the /etc/hosts file is not set properly, it will return "localhost" or throw
exception. So, at this circumstance, we will get the address by connecting a network address.

@return local host name
ngrinder-core/src/main/java/net/grinder/util/NetworkUtils.java