LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - Networking (http://www.linuxquestions.org/questions/forumdisplay.php?f=3)
-   -   gethostbyaddr vs getaddrinfo and getnameinfo (http://www.linuxquestions.org/questions/showthread.php?t=4175443115)

icegood 12-27-2012 08:32 AM

gethostbyaddr vs getaddrinfo and getnameinfo
 
Why gethostbyaddr treated as obsolete and getaddrinfo and getnameinfo should be used instead, if unde latter one i'm unable to get aliases from /etc/hosts while in case gethostbyaddr i will?

nini09 12-28-2012 02:21 PM

The gethostbyaddr performs netbios lookup. It is very slow when the host can't be found. The getnameinfo only contact DNS server, should be faster.

icegood 12-29-2012 05:29 PM

Thanks, what about aliases in /etc/hosts? Why they become unavailable under DNS?

nini09 12-31-2012 03:04 PM

In general, the file is for domain name and static host name. Some distribution could change file name to another one. It look like no affaction.


All times are GMT -5. The time now is 11:30 PM.