def subdomain_hook_legacy(name, domain, kind):
    """Legacy (default) hook for subdomains

    Users are at '$user.$host' where $user is _mostly_ DNS-safe.
    Services are all simultaneously on 'services.$host`.
    """
    if kind == "user":
        # backward-compatibility
        return f"{_dns_quote(name)}.{domain}"
    elif kind == "service":
        return f"services.{domain}"
    else:
        raise ValueError(f"kind must be 'service' or 'user', not {kind!r}")
Legacy (default) hook for subdomains

Users are at '$user.$host' where $user is _mostly_ DNS-safe.
Services are all simultaneously on 'services.$host`.
jupyterhub/utils.py