gethostbyname() and resolv.conf updates

Dan Winship danw at redhat.com
Mon Jun 21 13:01:44 UTC 2010


On 06/20/2010 04:41 AM, Nicolas Chauvet wrote:
> 2010/6/17 Bernie Innocenti <bernie at codewiz.org>:
>> Hello,
>>
>> xchat in Fedora needs to be restarted after switching to a different
>> nameserver or it fails to resolve.
>>
>> The xchat developers say that all xchat does is call gethostbyname(). A
> There was a topic 3 years ago  about replacing gethostby* functions by
> getaddrinfo
> Is this still relevant?

You definitely still want to replace gethostbyname with getaddrinfo,
because gethostbyname can't handle IPv6 addresses. But that's not
relevant to this particular problem (noticing resolv.conf updates)
because both functions use the same internal glibc methods, they just
package the results differently.

-- Dan


More information about the devel mailing list