[EMAIL PROTECTED] wrote:
> I'll bet that the first line in your /etc/hosts is:
> 
> 127.0.0.1               localhost localhost.localdomain
> 
> At least, that's the way it was with mine and, when I tried your program, I
> got the same "broken" answer you got.  After reading Per's message, I moved
> that line below the second line in my /etc/hosts so that it looks like this:
> 
> 198.41.2.245            knight.internic.net knight
> 127.0.0.1               localhost localhost.localdomain
> 
> Guess what?  It now works correctly.  I have a feeling that it shouldn't be
> dependent on your /etc/hosts entry order, but at least this will account for
> the difference between your and Per's results.
> 
> BTW, I'm testing this on a RH 5.1 system with sn's jdk-1.1.6v1.2.

My (that is me Per) /etc/hosts file has localhost as the first line,
but I have DNS configured and I think that is what made the difference
for me. I vaguely remember having a similar problem with the 
'hostname' command - it kept resulting in "localhost" until I changed
my hosts file.. Anyway, the problem is most likely not Java related.

/Per Widerlund

Reply via email to