SSH server normally is configured to perform reverse DNS lookup on every new connetion. Disabling the Reverse Lookup can improve connection speed.
Man sshd_config
UseDNS
Specifies whether sshd(8) should look up the remote host name and check that the resolved host name for the remote IP address maps back to the very same IP address. The default is ‘‘yes’’.
Check
You can observe the problem using tcpdump on port 53 on the ssh server. This situation can slower the sshconnection by 2-4 seconds for every DNS query.
tcpdump port 53
Fix
You can simply modify the ssh config file /etc/ssh/sshd_config
if not present append or modify, if present, the following line:
useDNS no
restart service
systemctl restart ssh