getting IP address of host in FreeBSD

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

getting IP address of host in FreeBSD

PRITHU
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 
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

getting IP address of host in FreeBSD

Robert Huff

PRITHU writes:

>  Does anyone know how to get the IP address of the host by any
>  other means?

        man 3 gethostbyname


                                Robert Huff

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "[hidden email]"