{"id":984,"date":"2018-09-17T19:03:11","date_gmt":"2018-09-17T10:03:11","guid":{"rendered":"https:\/\/chat-messenger.com\/?p=984"},"modified":"2018-12-23T01:50:22","modified_gmt":"2018-12-22T16:50:22","slug":"inetaddress-getbyname","status":"publish","type":"post","link":"https:\/\/chat-messenger.com\/ko\/blog\/java\/inetaddress-getbyname","title":{"rendered":"Java IP \uc8fc\uc18c\uc5d0\uc11c \ud638\uc2a4\ud2b8 \uc774\ub984 \uc5bb\uae30"},"content":{"rendered":"<h2 class=\"common_title\"><a name=\"0\">Java IP \uc8fc\uc18c\uc5d0\uc11c \ud638\uc2a4\ud2b8 \uc774\ub984 \uc5bb\uae30<\/a> <strong>InetAddress.getByName()<\/strong><\/h2>\n<p>\n\uc9c0\uc815\ub41c<strong>IP \uc8fc\uc18c<\/strong>\ud568\uaed8<strong>\ud638\uc2a4\ud2b8 \uc774\ub984<\/strong>(<strong>\uae30\uacc4 \uc774\ub984<\/strong>)\uc744 \uc5bb\ub294 \uc0d8\ud50c \ud504\ub85c\uadf8\ub7a8\uc785\ub2c8\ub2e4.\n<\/p>\n<h2 class=\"common_title\"><a name=\"1\">\uc0d8\ud50c \ud504\ub85c\uadf8\ub7a8<\/a><\/h2>\n<pre class=\"sample_src\">\/** * \uc9c0\uc815\ub41c IP \uc8fc\uc18c\ub97c \uac00\uc9c4 \ud638\uc2a4\ud2b8 \uc774\ub984\uc744 \uac00\uc838\uc635\ub2c8\ub2e4. * @param address IP \uc8fc\uc18c * @return \ud638\uc2a4\ud2b8\uba85 * \u203b\uc608\uae30\uce58 \uc54a\uc740 \uc608\uc678\uac00 \ubc1c\uc0dd\ud588\uc744 \uacbd\uc6b0\ub294, \uce90\ub9ad\ud130 \ub77c\uc778 &quot;UnknownHost&quot; \ub97c \ub3cc\ub824\uc90d\ub2c8\ub2e4. *\/ public static String getHostName(String address) { try { InetAddress iaddress = InetAddress.getByName(address); return iaddress.getHostName(); } catch (Exception e) { e.printStackTrace(); } return &quot;Unkn\r\n<\/pre>\n<p><script type=\"text\/javascript\" src=\"https:\/\/chat-messenger.com\/js\/common.js?dd12sssas2223\" charset=\"UTF-8\"><\/script><br \/>\n<script type=\"text\/javascript\"> writePR(); <\/script><\/p>\n<h2 class=\"common_title\"><a name=\"2\">\uc2e4\ud589 \uacb0\uacfc<\/a><\/h2>\n<p>\u25c6\uc2e4\ud589\uc608<\/p>\n<pre class=\"sample_src\">public static void main(String[] args) { String name = getHostName(&quot;66.249.89.99&quot;); System.out.println(&quot;\ud638\uc2a4\ud2b8 \uc774\ub984 = &#039;&quot;+name+&quot;&#039;&quot;); }\r\n<\/pre>\n<p>\u25c6\ucd9c\ub825 \uacb0\uacfc<\/p>\n<pre class=\"console\">\ud638\uc2a4\ud2b8 \uc774\ub984 = &#039;kr-in-f99.google.com&#039;\r\n<\/pre>","protected":false},"excerpt":{"rendered":"<p>Java IP \uc8fc\uc18c\ub85c\ubd80\ud130 \ud638\uc2a4\ud2b8\uba85\uc744 \ucde8\ub4dd InetAddress.getByName() \uc9c0\uc815\ub41c IP \uc8fc\uc18c [\u2026]<\/p>","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":""},"categories":[19],"tags":[],"_links":{"self":[{"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/posts\/984"}],"collection":[{"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/comments?post=984"}],"version-history":[{"count":4,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/posts\/984\/revisions"}],"predecessor-version":[{"id":1869,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/posts\/984\/revisions\/1869"}],"wp:attachment":[{"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/media?parent=984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/categories?post=984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/tags?post=984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}