RTFM: getLocalHost public static InetAddress getLocalHost() throws UnknownHostException Returns the local host. If there is a security manager, its checkConnect method is called with the local host name and -1 as its arguments to see if the operation is allowed. If the operation is not allowed, an InetAddress representing the loopback address is returned. Returns: the IP address of the local host. Throws: UnknownHostException - if no IP address for the host could be found. See Also: SecurityMan