/** * Determines the IP address of a host * @param name The hostname to look up * @return The first matching IP address * @exception UnknownHostException The hostname does not have any addresses */ public static InetAddress getByName(String name) throws UnknownHostException { try { return getByAddress(name); } catch (UnknownHostException e) { Record [] records = lookupHostName(name); return addrFromRecord(name, records[0]); } }
/** * Determines the IP address of a host * @param name The hostname to look up * @return The first matching IP address * @exception UnknownHostException The hostname does not have any addresses */ public static InetAddress getByName(String name) throws UnknownHostException { try { return getByAddress(name); } catch (UnknownHostException e) { Record [] records = lookupHostName(name, false); return addrFromRecord(name, records[0]); } }
/** * Determines the IP address of a host * @param name The hostname to look up * @return The first matching IP address * @exception UnknownHostException The hostname does not have any addresses */ public static InetAddress getByName(String name) throws UnknownHostException { try { return getByAddress(name); } catch (UnknownHostException e) { Record [] records = lookupHostName(name); return addrFromRecord(name, records[0]); } }
/** * Determines the IP address of a host * @param name The hostname to look up * @return The first matching IP address * @exception UnknownHostException The hostname does not have any addresses */ public static InetAddress getByName(String name) throws UnknownHostException { try { return getByAddress(name); } catch (UnknownHostException e) { Record [] records = lookupHostName(name); return addrFromRecord(name, records[0]); } }
/** * Determines all IP address of a host * @param name The hostname to look up * @return All matching IP addresses * @exception UnknownHostException The hostname does not have any addresses */ public static InetAddress [] getAllByName(String name) throws UnknownHostException { try { InetAddress addr = getByAddress(name); return new InetAddress[] {addr}; } catch (UnknownHostException e) { Record [] records = lookupHostName(name, true); InetAddress [] addrs = new InetAddress[records.length]; for (int i = 0; i < records.length; i++) addrs[i] = addrFromRecord(name, records[i]); return addrs; } }
/** * Determines all IP address of a host * @param name The hostname to look up * @return All matching IP addresses * @exception UnknownHostException The hostname does not have any addresses */ public static InetAddress [] getAllByName(String name) throws UnknownHostException { try { InetAddress addr = getByAddress(name); return new InetAddress[] {addr}; } catch (UnknownHostException e) { Record [] records = lookupHostName(name); InetAddress [] addrs = new InetAddress[records.length]; for (int i = 0; i < records.length; i++) addrs[i] = addrFromRecord(name, records[i]); return addrs; } }
/** * Determines all IP address of a host * @param name The hostname to look up * @return All matching IP addresses * @exception UnknownHostException The hostname does not have any addresses */ public static InetAddress [] getAllByName(String name) throws UnknownHostException { try { InetAddress addr = getByAddress(name); return new InetAddress[] {addr}; } catch (UnknownHostException e) { Record [] records = lookupHostName(name); InetAddress [] addrs = new InetAddress[records.length]; for (int i = 0; i < records.length; i++) addrs[i] = addrFromRecord(name, records[i]); return addrs; } }
/** * Determines all IP address of a host * @param name The hostname to look up * @return All matching IP addresses * @exception UnknownHostException The hostname does not have any addresses */ public static InetAddress [] getAllByName(String name) throws UnknownHostException { try { InetAddress addr = getByAddress(name); return new InetAddress[] {addr}; } catch (UnknownHostException e) { Record [] records = lookupHostName(name); InetAddress [] addrs = new InetAddress[records.length]; for (int i = 0; i < records.length; i++) addrs[i] = addrFromRecord(name, records[i]); return addrs; } }