Here you can find the source of checkHost(String host)
public static boolean checkHost(String host)
//package com.java2s; //License from project: Open Source License import java.net.*; public class Main { public static boolean checkHost(String host) { try {/*from w w w . j a v a2 s . c o m*/ InetAddress.getByName(host); return (true); } catch (UnknownHostException uhe) { return (false); } } }