> > So my question is: is it wrong for the localhost entry in /etc/hosts to
> > contain the machine name?  [...]
> 
> Yes, it's wrong, but it is commonly done on windows and on unix machines
> in the initial installation steps.  It should not be left that way
> unless the machine has no network interfaces.

I'll disagree ... it's not wrong.  Sun has a tradition of assuming
that network interfaces have unique names, but that's not the
way the Internet was designed to work.  Neither /etc/hosts nor
DNS attempts to enforce such policies.  Yellow Pages (NIS)
does have that policy, which explains why this problem shows
up in other software from Sun (not just JDK 1.0, 1.1, 1.2., 1.3)
when it's used in non-NIS environments.


> getLocalHost() isn't broken, it's doing exactly what your machine's 
> /etc/hosts was telling it to do.

But getLocalHost() does indeed have problems, as noted in the
bug report someone else posted:

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

It's a conceptual problem, since it equates "host" (typically at least
two interfaces, counting the loopback network) with "interface".
Which is just a broken assumption.

I'm glad to see this finally got accepted and fixed ... though I wish
some of the copies of this bug that were filed against JDK 1.0 had
been fixed!!

- Dave



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

Reply via email to