try { InetAddress ia = InetAddress.getByName("152.2.22.3"); System.out.println(ia.getHostName()); } catch (Exception e) { System.err.println(e); }