This article is from the SSH - Secure Shell FAQ, by Thomas Koenig Thomas.Koenig@ciw.uni-karlsruhe.de with numerous contributions by others.
Check whether gethostbyname() really returns the complete lists of
possible IP addresses (you might, for example, have your system
configured to search /etc/hosts first, which might contain only one of
the IP addresses).
 
Continue to: