java.net.InetAddress," which has everything you need to get the user's host name and address.
The following source...
/* There are a few instances in which the browser cannot ascertain the user's address, so we will instruct the browser to ignore errors by setting the onerror handler to null: */
window . onerror = null;/* We will also give hostaddress and hostname a default value in case the address look-up fails: */
hostaddress = hostname = "(unknown)";/* Now we will try to gather the host information: */
hostaddress = localhost . getHostAddress ();
hostname = localhost . getHostName ();
document . writeln ("<p>Your IP address is <b>" + hostaddress + "</b>.</p>");
document . writeln ("<p>Your hostname is <b>" + hostname + "</b>.</p>");