NetBSD-Users archive

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

gethostbyname & RES_USE_INET6

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.

Thanks & Regards,

Home | Main Index | Thread Index | Old Index