This page describes how admin user can limit new user registration for specific domain. The domain can be any random domain as the app does not validate domain ownership, it uses it for whitelisting user registration from that specified domain.
Follow below steps for domain whitelisting:
sudo vi /home/ubuntu/setup/danswer/deployment/docker_compose/.env
sudo docker ps |cut -d " " -f 1|xargs sudo docker stop
sudo docker ps -a|cut -d " " -f 1|xargs sudo docker rm
cd setup/danswer/deployment/docker_compose/
sudo docker compose -f /home/ubuntu/setup/danswer/deployment/docker_compose/docker-compose.prod-no-letsencrypt.yml -p danswer-stack up -d --force-recreate
And it should restrict users from other domains.