getting IP address of host in FreeBSD

PRITHU prithula at yahoo.com
Fri Dec 16 17:07:48 PST 2005


Dear all,
        I tried to get the IP address of the host in FreeBSD 5.4 using the getLocalhost() method of the InetAddress class. It gave an UnknownHost exception until I put the entry corresponding to the hostname in the file /etc/hosts. But, this solution is not good enough, since it requires to hard code the IP address and hostname mapping in the /etc/hosts/ file. Does anyone know how to get the IP address of the host by any other means?
   
  Thank You,
  Prithula Dhungel.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the freebsd-java mailing list