Here you can find the source of getIntranetIp()
public static String getIntranetIp()
//package com.java2s; //License from project: Open Source License import java.net.InetAddress; public class Main { private static String intranetIp; public static String getIntranetIp() { if (intranetIp == null) { try { intranetIp = InetAddress.getLocalHost().getHostAddress(); } catch (Exception e) { intranetIp = "127.0.0.1"; }//from w w w . j a va2s .c om } return intranetIp; } }