Here you can find the source of getInetAddress(String name)
public static InetAddress getInetAddress(String name)
//package com.java2s; //License from project: Open Source License import java.net.*; public class Main { /**// www. j a v a2s . c o m * Get an InetAddress by name returning {@code null} if there is an error * resolving the name. */ public static InetAddress getInetAddress(String name) { try { return InetAddress.getByName(name); } catch (Exception ex) { return null; } } /** * Create and return an InetAddress from the given array of octets returning * {@code null} if there are any errors instead of throwing an exception. */ public static InetAddress getInetAddress(byte[] addrBytes) { try { return InetAddress.getByAddress(addrBytes); } catch (Exception ex) { return null; } } }