> As far as I understand, inet_gethost uses getipnodebyname and
> getipnodebyaddr functions.
> It seems that both functions aren't implemented in Linux (probably
> they require some unusual libraries?).
The man page says that
"These functions are deprecated. Use getaddrinfo(3) and getnameinfo(3)
These functions have been present in glibc 2.1.91-95, but were removed
again. Several Unix-like systems support them, but all call them
> Mikael Magnusson has sent a patch (attached, patch is for R11B-2) to
> Debian bugs database. It adds IPv6 addresses resolution using
> gethostbyname2 and gethostbyaddr.
gethostbyname2 is a GNU extension.
> I hope it will be useful not only for Debian users.
Using getaddrinfo and getnameinfo might be a better idea then?
Re: [erlang-questions] IPv6 support in inet_gethost
Jani Hakala wrote:
>> I hope it will be useful not only for Debian users.
> Using getaddrinfo and getnameinfo might be a better idea then?
Surely. My colleague Love Hörnquist Åstrand wrote such a patch once, but
it could never be accepted by the OTP group because with getaddrinfo
you don't get the same hostent aliases as you do with gethostbyname.
This broke the Ericsson test suite for NIS on Solaris (or something
equally yucky), and as far as I know no progress was ever made.
A workaround is to issue these two commands to make your Erlang node use
the good ol' native Erlang resolver :