getLocalHost() Always Returns Loopback?

Chris Doherty chris-freebsd at
Wed Apr 7 09:49:22 PDT 2004

On Wed, Apr 07, 2004 at 09:56:39AM -0600, Ryan Sommers said: 
> I'm having a lot of difficulty getting InetAddress.getLocalHost() to
> return anything besides the loopback address. After hours of scouring
> google I've found this is a common problem. Most of the solutions have to
> deal with the java.policy file.

additional specific data points that don't solve your problem:

Windows 2000, Weblogic JDK 1.3.1_03: returns non-loopback
Linux (kernel 2.6), JDK 1.4.2_01: returns non-loopback
FreeBSD -stable from 8 Jan 2004, native JDK 1.3.1-p9: returns loopback
FreeBSD -stable from 8 Jan 2004, linux JDK 1.3.1_10: returns loopback


Chris Doherty

"I think," said Christopher Robin, "that we ought to eat
all our provisions now, so we won't have so much to carry."
               -- A. A. Milne

More information about the freebsd-java mailing list