def METHOD_NAME(session_multihost, request):
    """ Change client hostname to a truncated version in the AD domain"""
    cmd = session_multihost.client[0].run_command(
        'hostname', raiseonerr=False)
    ad_domain = session_multihost.ad[0].domainname
    old_hostname = cmd.stdout_text.rstrip()
    hostname = f'client{random.randint(1,99)}.{ad_domain}'
    session_multihost.client[0].run_command(
        f'hostname {hostname}', raiseonerr=False)
    def restore():
        """ Restore hostname """
        session_multihost.client[0].run_command(
            f'hostname {old_hostname}',
            raiseonerr=False
        )
    request.addfinalizer(restore)