Here you can find the source of isLocalAddress(final String address)
public static boolean isLocalAddress(final String address) throws UnknownHostException
//package com.java2s; //License from project: Apache License import java.net.InetAddress; import java.net.UnknownHostException; public class Main { public static boolean isLocalAddress(final String address) throws UnknownHostException { final InetAddress inetAddress = InetAddress.getByName(address); return inetAddress.isLinkLocalAddress() || inetAddress.isAnyLocalAddress() || inetAddress.isLoopbackAddress(); }/*w w w . j ava 2 s.c o m*/ }