import java.net.InetAddress;
import java.net.UnknownHostException;

public class InetAddressDemo {
	public static void main(String[] args) throws UnknownHostException {
		
		InetAddress ia = InetAddress.getByName("www.facebook.com");
		InetAddress local = InetAddress.getLocalHost();

		System.out.println("입력한 페이지 명: " + ia.getHostName());
		System.out.println("입력한 페이지 IP: " + ia.getHostAddress());
		System.out.println();
		System.out.println("로컬 명: " + local.getHostName());
		System.out.println("로컬 IP: " + local.getHostAddress());
		
	}
}
posted by 쪼재