For me this change (minimal change, only adding "[NOTFOUND=return]" after dns, not changing the order) in /etc/nsswitch.conf fixed my problem of slow SSH connecting in internal network (where UseDNS=no in sshd_config did not help):
-hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
+hosts: files mdns4_minimal [NOTFOUND=return] dns [NOTFOUND=return] mdns4
For me this change (minimal change, only adding "[NOTFOUND=return]" after dns, not changing the order) in /etc/nsswitch.conf fixed my problem of slow SSH connecting in internal network (where UseDNS=no in sshd_config did not help):
-hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
+hosts: files mdns4_minimal [NOTFOUND=return] dns [NOTFOUND=return] mdns4