And to top that, not all IP addresses will be reachable from off the machine. The problem is that a host could have lots of network interfaces, and an interface could be bound to more than one IP address. On the face of it, InetAddress.getLocalHost() should give you the IP address of this host.