code: public static String normalizeHostName(String name) {
  		if (Character.digit(name.charAt(0), 16) != -1) { // it is an IP
  			return name;
  		} else {
  			try {
  				InetAddress ipAddress = InetAddress.getByName(name);
  				return ipAddress.getHostAddress();
  			} catch (UnknownHostException e) {
  				return name;
  			}
  		}
  	}
docs: Given a string representation of a host, return its ip address
  in textual presentation.
  
  @param name
  a string representation of a host:
  either a textual representation its IP address or its host name
  @return its IP address in the string format