Java Host Check checkHost(String host)

Here you can find the source of checkHost(String host)

Description

check Host

License

Open Source License

Declaration

public static boolean checkHost(String host) 

Method Source Code


//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);
        }
    }
}

Related

  1. checkHost(String hostname)
  2. checkHostIsAvailable(String hostName)
  3. checkHostName(String hostName)
  4. isHostReachable(String host, int timeout)