Users who often log on to SSH can feel that every time they log on to SSH, they always have to wait for a moment to connect. This is because the OpenSSH server has a DNS search option, UseDNS is enabled by default.
When the UseDNS option is enabled, when the client attempts to log on to the SSH server, the server first performs dns ptr lookup Based on the client's IP address to obtain the client's host name, then, the DNS is querying the record based on the client host name to verify whether it is consistent with the original IP address. This is A measure to prevent Client Spoofing, however, we generally do not have PTR records for Dynamic IP addresses. Opening this option is just a waste of time. It is better to disable it.
I. editing files
Vim/etc/ssh/sshd_config
2. Find the following characters
# UseDNS yes
Create a new row under it and enter
UseDNS no
3. Save and restart SSH
Service sshd restart
A few simple steps are completed.