Re: gethostbyname returns "No such device"?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 26 Jul 2004 shinepeak@xxxxxxxxxxxx wrote:

Hello!

  When I call gethostbyname() to get IP of localhost, it returned NULL, and perror() displayed "No such device". Why? My network was configured correctly.


Check your entry in /etc/hosts. gethostbyname uses /etc/hosts for the IPs of localhost; otherwise the function uses /etc/resolve.conf, if you are connected to any network.

  Thank you!
______________________________________


===================================================================

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


** Quote for thought:

"To live a pure unselfish life, one must count nothing as one's own in the midst of abundance." -- Buddha

-------------------------
Dinil Divakaran
M S
DON Lab (x8353, x8953)
IIT Madras
-------------------------

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux