I had a particular Centos 8 box that had very slow logins but over ssh but also using su. The issue was not with dns and ssh. I finally found the problem – or at least the fix (related to systemd, sigh):
systemctl restart systemd-logind
The server was running inside of openvz so perhaps there were resource issues at some point. I did not have time to determine why it broke but the above did fix it.