This question already has an answer here:

As I have come to understand, SSH always goes through the process of reverse DNS lookups whether you are connecting to or a local server calleduser@ I do not know, however, why the SSH command performs a reverse dns lookup for IP addresses regardless. Like, I had to change my DNS server configuration on my Pi to Google's open DNS so that my client machine wouldn't take so long to actually handshake with the server through DNS lookup with my ISPs DNS servers. Even when my Pi is on my local network.

tl;dr - Why does SSH do reverse DNS lookup for local IP addresses?

marked as duplicate by lcd047, garethTheRed, PersianGulf, jimmij, Wouter Verhelst Jun 26 '16 at 12:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • So what is the question ? Do you want to know how to change your DNS ? What is the distribution you are running on your Pi ? – Dieter G Jun 25 '16 at 15:35
  • (1) There is no such thing as "reverse DNS lookups for domains", reverse lookups only make sense for IPs. (2) ssh(1) doesn't do any reverse DNS lookups, sshd(8) does. (3) sshd(8) does reverse DNS lookups because that's what its authors made it do. :) You can disable this behaviour if you want. (4) Google DNS (or any other public DNS) won't answer queries for non-routable addresses, such as 192.168.x.y. You need a local properly configured DNS server if you want reverse resolution on your local net. (5) You already posted this question. Flagging. – Satō Katsura Jun 25 '16 at 17:24
  • Sorry, this is a different question from my other one and the others do not answer – user4191887 Jun 25 '16 at 17:57

You can set the option

UseDNS no

in the file /etc/ssh/sshd_config on your server to tell sshd(8) not to do DNS lookups.

Not the answer you're looking for? Browse other questions tagged or ask your own question.