NetBSD-Users archive

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

Re: gethostbyname & RES_USE_INET6



In article 
<515c64960904010406k345683b0r5171a799de59c389%mail.gmail.com@localhost>,
Channa  <channa.kad%gmail.com@localhost> wrote:
>Hi,
>I am facing some problem while using the gethostbyname() API for IPv6
>address. I have the following entry in my /etc/hosts
>
>$ cat /etc/hosts
>::1         localhost6.localdomain
>
>When i try to get the entry for gethostbyname("localhost6.localdomain")
>the return value is NULL.
>
>But when i set the RES_OPTIONS as
>
>$ export RES_OPTIONS=inet6
>
>gethostbyname() works fine.
>
>Is it required for me set the environment variable RES_OPTIONS every time?
>Or this needs to be set in any of the networking functions?
>
>Please help me out in this regard.

Don't use gethostbyname() use getaddrinfo().

christos



Home | Main Index | Thread Index | Old Index