I think that the following the following should help sorting some of
these issues out.  There are a variety of issues related to the way the
InetAddress object works.  I personally was having a problem getting all
IPs for a multi-homed node, but I think that this also addresses the
issue that you're having.  Anyway, supposedly a fix for this behavior is
coming with Merlin.

http://developer.java.sun.com/developer/bugParade/bugs/4327220.html

pdw wrote:
> 
> InetAddress.getLocalHost() is supposed to return the ip address of the local
> host.  But on my machine (Debian Linux, Blackdown 1.3, using DHCP) it
> returns 127.0.0.1.  This makes sense, sort of, because 127.0.0.1 is a valid
> address for this machine.  but it is useless.
> 
> Here is the interesting thing.  my /etc/hosts looks like this:
> 
> 127.0.0.1       aganthapus      localhost
> 
> but if I change it to this:
> 
> 127.0.0.1       localhost
> 
> then it works correctly!  "aganthapus" is the machine name, and I guess
> debian put it in there.  I think this makes sense because getLocalHost()
> does this:
> 
> localHost = getAllByName(localHost.hostName)[0];
> 
> so it finds the first entry that matches "aganthapus", which is 127.0.0.1.
> So my question is: is it wrong for the localhost entry in /etc/hosts to
> contain the machine name?  If not, getLocalHost() is broken.
> 
> Paul
> 
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

-- 

Jesse Erdmann 
Engineer 
Secure Computing Corp.
Tel. (651) 628-1535


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to