[erlang-questions] Broken ipv6 behavior?

Matthew Dempsky <>
Wed Apr 9 03:14:34 CEST 2008


Okay, so now that breaks looking up localhost:

:/tmp$ erl -kernel inetrc '"/tmp/inetrc"'
Erlang (BEAM) emulator version 5.6.1 [source] [smp:2]
[async-threads:0] [kernel-poll:false]

Eshell V5.6.1  (abort with ^G)
1> inet_db:set_lookup([dns]).
ok
2> inet_db:add_ns({10,0,1,40}).
ok
3> inet:getaddr("ipv6.google.com", inet6).
{ok,{8193,18528,0,4097,0,0,0,104}}
4> inet:getaddr("localhost", inet).
{error,nxdomain}
5> inet:getaddr("localhost", inet6).
{error,nxdomain}

Looking at my DNS cache logs, Erlang is now sending queries for
localhost.local.

If I change [dns] to [files, dns], and it gives the same wrong output.
(I also tried adding "9.9.9.9 localhost.local" to /etc/hosts, and it
still gives nxdomain.)


On Tue, Apr 8, 2008 at 5:40 PM, Tony Rogvall <> wrote:
> I you do this:
>
>  inet_db:set_lookup([dns]).
>  inet_db:add_ns({A,B,C,D}).  %% Name server must be IPv4, there is a fixme
> in inet_db.
>
>  inet:getaddr("ipv6.google.com", inet6).
>  {ok,{8193,18528,0,4097,0,0,0,104}}
>
>
>  /Tony
>
>
>  On 9 apr 2008, at 01.42, Matthew Dempsky wrote:
>
>
>
> > On Tue, Apr 8, 2008 at 4:22 PM, Tony Rogvall <> wrote:
> >
> > > Make sure the {inet6, Bool} in the inetrc is set to true?
> > >
> > > See ERTS User's Guide / Inet configuration.
> > >
> >
> > Makes no difference.  DNS cache still only shows an A query.
> >
> > :/tmp$ echo '{inet6, true}.' > inetrc
> > :/tmp$ erl -kernel inetrc '"/tmp/inetrc"'
> > Erlang (BEAM) emulator version 5.6.1 [source] [smp:2]
> > [async-threads:0] [kernel-poll:false]
> >
> > Eshell V5.6.1  (abort with ^G)
> > 1> inet:getaddr("ipv6.google.com", inet6).
> > {error,nxdomain}
> >
>
>



More information about the erlang-questions mailing list