开发者

gethostbyname problem

开发者 https://www.devze.com 2022-12-09 22:45 出处:网络
I wish to use \"gethostbyname\" in my Suse m/c but it is not returning any s开发者_Python百科tructure.

I wish to use "gethostbyname" in my Suse m/c but it is not returning any s开发者_Python百科tructure.

but on the other systems it is working fine what could be the issue with my m/c ??


Note that the new way of doing it is using getaddrinfo see beej guide


To gethostbyname to work an entry in /etc/hosts to be made ... :) I was missing that thanks for answers.


If “ping somehost” on the command line works for you, gethostbyname should work, too, when used correctly. Read manpage resolv.conf(5) for details on how to configure name resolution.

If you get ping working but your code still fails, please post an example.

0

精彩评论

暂无评论...
验证码 换一张
取 消