Here you can find the source of getInetAddress()
private static InetAddress getInetAddress()
//package com.java2s; //License from project: Apache License import java.net.InetAddress; import java.net.UnknownHostException; public class Main { private static String hostName; private static InetAddress getInetAddress() { try {/* www . j a v a2 s . c o m*/ return InetAddress.getLocalHost(); } catch (UnknownHostException e) { hostName = "unknown host!"; } return null; } }