extract hostname from its class