/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tcp;

/**
 *
 * @author rafal
 */
import java.net.InetAddress;
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
    try {
        //10.117.11.142
        InetAddress ias[] = InetAddress.getAllByName("remoto.pl");
        for (int i = 0; i < ias.length; i++)
            {
                System.out.println(ias[i].getHostName());
                System.out.println(ias[i].getHostAddress());
                byte bytes[] = ias[i].getAddress();
                for (int j = 0; j < bytes.length; j++)
                    {
                      if (j > 0)
                        System.out.print(".");
                      if (bytes[j] >= 0)
                        System.out.print(bytes[j]);
                      else
                        System.out.print(bytes[j] + 256);
                    }
                System.out.println("");
             }
         } 
        catch (Exception e)
            {
            e.printStackTrace();
            }
    }

}
