code: public static String getConnectHost(ServiceType service, AlluxioConfiguration conf) {
      if (conf.isSet(service.mHostNameKey)) {
        String connectHost = conf.get(service.mHostNameKey);
        if (!connectHost.isEmpty() && !connectHost.equals(WILDCARD_ADDRESS)) {
          return connectHost;
        }
      }
      if (conf.isSet(service.mBindHostKey)) {
        String bindHost = conf.get(service.mBindHostKey);
        if (!bindHost.isEmpty() && !bindHost.equals(WILDCARD_ADDRESS)) {
          return bindHost;
        }
      }
      return getLocalHostName((int) conf.getMs(PropertyKey.NETWORK_HOST_RESOLUTION_TIMEOUT_MS));
    }
docs: Provides an externally resolvable hostname for client to communicate with the service. If the
  hostname is not explicitly specified, Alluxio will try to use the bind host. If the bind host
  is wildcard, Alluxio will automatically determine an appropriate hostname from local machine.
  The various possibilities shown in the following table:
  <table>
  <caption>Hostname Scenarios</caption>
  <thead>
  <tr>
  <th>Specified Hostname</th>
  <th>Specified Bind Host</th>
  <th>Returned Connect Host</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>hostname</td>
  <td>hostname</td>
  <td>hostname</td>
  </tr>
  <tr>
  <td>not defined</td>
  <td>hostname</td>
  <td>hostname</td>
  </tr>
  <tr>
  <td>hostname</td>
  <td>0.0.0.0 or not defined</td>
  <td>hostname</td>
  </tr>
  <tr>
  <td>not defined</td>
  <td>0.0.0.0 or not defined</td>
  <td>localhost</td>
  </tr>
  </tbody>
  </table>
  
  @param service Service type used to connect
  @param conf configuration
  @return the externally resolvable hostname that the client can use to communicate with the
  service.