<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Schiff Heimlich</title>
    <description>The latest articles on DEV Community by Schiff Heimlich (@schiff_heimlich).</description>
    <link>https://dev.to/schiff_heimlich</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3949704%2F89c08e96-274f-4f09-a299-8ebdabdc7096.jpg</url>
      <title>DEV Community: Schiff Heimlich</title>
      <link>https://dev.to/schiff_heimlich</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/schiff_heimlich"/>
    <language>en</language>
    <item>
      <title>SSH Login Taking Forever? Check Your DNS Settings</title>
      <dc:creator>Schiff Heimlich</dc:creator>
      <pubDate>Mon, 25 May 2026 01:05:23 +0000</pubDate>
      <link>https://dev.to/schiff_heimlich/ssh-login-taking-forever-check-your-dns-settings-gej</link>
      <guid>https://dev.to/schiff_heimlich/ssh-login-taking-forever-check-your-dns-settings-gej</guid>
      <description>&lt;h1&gt;
  
  
  SSH Login Taking Forever? Check Your DNS Settings
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Situation
&lt;/h2&gt;

&lt;p&gt;You type &lt;code&gt;ssh user@server&lt;/code&gt;, hit enter, and wait. And wait. Ten seconds later, the password prompt finally appears. It's not network latency — ping is fine. It's not the server — other people connect instantly. It's just your SSH client hanging for no obvious reason.&lt;/p&gt;

&lt;p&gt;This is one of those problems that wastes a small amount of time on a regular basis, which adds up to a large amount of time over months.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Was Done
&lt;/h2&gt;

&lt;p&gt;The culprit is almost always DNS resolution. When SSH tries to connect, it does a reverse DNS lookup on your client IP by default. If your system's DNS resolver is slow, broken, or configured to time out, you get that delay.&lt;/p&gt;

&lt;p&gt;The fix is straightforward: disable DNS lookups in your SSH client.&lt;/p&gt;

&lt;p&gt;Add this to &lt;code&gt;~/.ssh/config&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;Host&lt;/span&gt; *
    &lt;span class="k"&gt;UseDNS&lt;/span&gt; &lt;span class="no"&gt;no&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Restart your SSH connection and the delay disappears.&lt;/p&gt;

&lt;p&gt;If you're curious why this happens: SSH calls &lt;code&gt;getaddrinfo()&lt;/code&gt; which goes through your resolver. On systems with systemd-resolved, the stub resolver sometimes has issues with certain query types. On VPS environments, DNS can route through slow upstream resolvers. The lookup eventually times out or succeeds, but you've already lost those seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaway
&lt;/h2&gt;

&lt;p&gt;Before you blame the network, the server, or your ISP — check if SSH is doing DNS lookups. The &lt;code&gt;UseDNS no&lt;/code&gt; option is a one-line fix that pays off every single time you connect.&lt;/p&gt;

&lt;p&gt;If you're managing servers and want to help your users, make sure reverse DNS works correctly for your IP ranges. That way, users who keep &lt;code&gt;UseDNS&lt;/code&gt; on (the default) won't suffer either.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;It's a small quality-of-life fix. But small fixes that you use dozens of times a day add up.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>linux</category>
      <category>networking</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
