2012. 5. 15. 14:50

DNS 서버로 IP address 를 조회해서 출력하는 듯.


InetAddress inetAddress = InetAddress.getByName("www.google.co.kr");


System.out.println(inetAddress);

System.out.println(inetAddress.getCanonicalHostName());

System.out.println(inetAddress.getHostName());

System.out.println(inetAddress.getHostAddress());


결과

www.google.co.kr/74.125.71.94

hx-in-f94.1e100.net

www.google.co.kr

74.125.71.94


'java > etc' 카테고리의 다른 글

유한상태기계(Finite State Machine, FSM)  (0) 2016.05.24
[etc] - enum 사용 예  (0) 2014.12.24
[URL] - FTP 접속 URL  (0) 2012.05.15
[AES] - 256bit 키를 인식하지 못할 때 사용하는 방법  (0) 2011.11.30
[etc] - 테스트 유형  (0) 2010.12.21
Posted by 짱가쟁이