private static InetAddress toIpAddress(String hostName){
  try {
    if (InetAddressValidator.isValid(hostName)) {
      return InetAddress.getByName(hostName);
    }
  }
 catch (  UnknownHostException e) {
  }
  return null;
}

private static InetAddress toIpAddress ( String hostName ) { try { if ( InetAddressValidator . isValid ( hostName ) ) { return InetAddress . getByName ( hostName ) ; } } catch ( UnknownHostException e ) { } return null ; }
convert to an ip address without performing a dns lookup .
