Here you can find the source of isHostInNetworkCard(String host)
public static boolean isHostInNetworkCard(String host)
//package com.java2s; //License from project: Open Source License import java.net.InetAddress; import java.net.NetworkInterface; public class Main { public static boolean isHostInNetworkCard(String host) { try {/*from ww w . j ava2s.co m*/ InetAddress address = InetAddress.getByName(host); NetworkInterface networkInterface = NetworkInterface.getByInetAddress(address); return networkInterface != null; } catch (Exception e) { return false; } } }