Try InetAddress.getLocalHost().getHostName() and InetAddress.getLocalHost().getHostAddress(). This will give u both name and the address of the localhost. Hope this helps. If not give me a message. Vinod.