📖 ~1 min read
Table of contents
Symptom & Impact
SSH connections to Ubuntu 22.04 pause for several seconds before password or key prompt appears.
Environment & Reproduction
Ubuntu 22.04 OpenSSH server in networks with missing PTR records or unreachable DNS resolver paths.
Root Cause Analysis
sshd waits for reverse lookup/hostname validation, and DNS timeout propagates directly into authentication delay.
Quick Triage
Test with ssh -vvv, verify DNS latency using dig -x client_ip, and inspect resolver health with resolvectl statistics.
Step-by-Step Diagnosis
Review /var/log/auth.log timestamps, correlate with DNS query timeouts, and inspect sshd configuration for UseDNS behavior.

Solution – Primary Fix
Set UseDNS no in /etc/ssh/sshd_config for affected hosts, ensure valid resolver config, then reload sshd gracefully.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Solution – Alternative Approaches
Fix PTR records in DNS, add caching resolver nearby, or enforce known_hosts and strict key-based authentication policies.
Verification & Acceptance Criteria
New SSH sessions prompt immediately, auth.log timings normalize, and automation jobs complete without connection delay.
Rollback Plan
Restore prior sshd_config and reload service if environment requires DNS-based host validation for compliance.
Prevention & Hardening
Monitor SSH handshake latency, maintain DNS records lifecycle, and codify sshd settings in configuration management.
Related Errors & Cross-Refs
Related Ubuntu 22.04 issues include DNS stub failures, firewall drops to resolver, and intermittent packet loss.
Related tutorial: View the step-by-step tutorial for Ubuntu 22.04 LTS.
View all Ubuntu 22.04 LTS tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
man sshd_config, OpenSSH hardening guides, Ubuntu SSH server docs, and DNS troubleshooting playbooks.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.