I am writing an application where I need the IP address. I have a domain name and I would like to know how to get the IP address from it. For example, \"www.girionjava.com\". Ho
(Extra mask in printing sine java considers all integers to be signed, but an IP address is unsigned)
InetAddress[] machines = InetAddress.getAllByName("yahoo.com");
for(InetAddress address : machines){
byte[] ip = address.getAddress();
for(byte b : ip){
System.out.print(Integer.toString(((int)b)&0xFF)+".");
}
System.out.println();
}