def get_domain_id(ks_client, domain_name):
    """Return domain ID.

    :param ks_client: Authenticated keystoneclient
    :type ks_client: keystoneclient.v3.Client object
    :param domain_name: Name of the domain
    :type domain_name: string
    :returns: Domain ID
    :rtype: string or None
    """
    all_domains = ks_client.domains.list(name=domain_name)
    if all_domains:
        return all_domains[0].id
    return None