[erlang-questions] IPv6 support in inet_gethost

Fredrik Thulin <>
Tue Nov 21 15:57:08 CET 2006


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 :

   ets:insert(inet_db, {res_ns, [{{127, 0, 0, 1}, 53}]}).
   ets:insert(inet_db, {res_lookup, [dns]}).

Substitute {127, 0, 0, 1} with the address of your resolver - I don't 
know if it works with an IPv6 tuple.

/Fredrik




More information about the erlang-questions mailing list