Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

InetAddress's getHostName() Fails to work.

 
Parth Bhatt
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I have a problem with IP Address resolution in my lan. The following is the code that i used :



The above code fails to resolver the IP Address. I am using RedHat Linux 9. If i try


i get the Hostname, as expected. Can anyone help me as to why fails to IAddr.getHostName() return the hostame.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic