The Mac OS X has a busted getaddrinfo which does not cache responses. This results in terrible performance when getaddrinfo is being used. gethostbyname and getservbyname both cache and should be used instead until Apple fixes their getaddrinfo.