📖 ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

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.

Illustrative mockup for ubuntu-22-04-lts — ssh_rdns_problem
Slow SSH authentication due to reverse DNS timeout on Ubuntu 22.04 — Illustrative mockup — Progressive Robot

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.

Illustrative mockup for ubuntu-22-04-lts — ssh_rdns_solution
Fast SSH login after UseDNS tuning on Ubuntu 22.04 — Illustrative mockup — Progressive Robot

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 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.