code: public static ModelNode determineHostAddress(final ModelControllerClient client) throws IOException, OperationExecutionException {
          final ModelNode op = Operations.createReadAttributeOperation(EMPTY_ADDRESS, "local-host-name");
          ModelNode response = client.execute(op);
          if (Operations.isSuccessfulOutcome(response)) {
              return DeploymentOperations.createAddress("host", Operations.readResult(response).asString());
          }
          throw new OperationExecutionException(op, response);
      }
docs: Determines the address for the host being used.
  
  @param client the client used to communicate with the server
  
  @return the address of the host
  
  @throws IOException                 if an error occurs communicating with the server
  @throws OperationExecutionException if the operation used to determine the host name fails