From: Ville Mattila Date: 2001-02-20T17:55:46+09:00 Subject: [ruby-talk:11162] Re: TCPSocket.open() lasts 2 minutes (was: rwiki *hangs* in send()) Dave Thomas writes: > wys@helbling.ch (Clemens Wyss) writes: > > > wys@helbling.ch (Clemens Wyss) wrote in > 130.133.1.4>: > > > > >My (easy) testscript looks like this: > > > require 'socket' > > > soc = TCPSocket.open("localhost", 8470) > > > soc.close() > > > > > ...on the other hand "127.0.0.1" (instead of "localhost") finishes > > immediately. > > It sounds like you system is trying to resolve 'localhost' using DNS, > rather that the hosts file. What happens if you enter > > ping localhost > > at the command line? > > If this also takes a long time, check your file /etc/host.conf > contains something like > > order hosts bind > Or /etc/nsswitch.conf something like hosts: files dns