Socket::gethostbyname(host_name) finds IP address of host_name and then does reverse DNS lookup for IP address (was traced down using tcpdump on Mac OS X).
If DNS server is not returning reverse DNS name for IP adress, then this method on Mac OS X took about 20 seconds.
Discussed with headius on IRC and here are potential reasons:
headius: it seems that it's not our call to getByName, but a subsequent call to getCanonicalHostName that does it
On MRI it is not doing reverse DNS lookup and always is very fast.
Socket::gethostbyname(Socket::gethostname) call is used in DataObjects drivers and as a result on some machines loading DataObjects JDBC driver could take very long time.