No nameservers in R10B-0

Jimmy Olgeni olgeni@REDACTED
Fri Oct 15 21:36:09 CEST 2004


Hi,

On Fri, 15 Oct 2004, Fredrik Thulin wrote:

> I have tried very hard now to understand why IPv6 resolving of hostnames
> does not work for me with Erlang R10B-0 on Linux, when it works just
> fine with R9C-0 (on the same host, Erlang compiled at the same time in
> the same way).

This is from FreeBSD 5.3-BETA7:

Erlang (BEAM) emulator version 5.4 [source] [threads:0]

Eshell V5.4  (abort with ^G)
1> inet:gethostbyname("incomingproxy.devel.sip.su.se", inet6).
{ok,{hostent,"lab08.lab.it.su.se",
              ["incomingproxy.devel.sip.su.se"],
              inet6,
              16,
              [{8193,1712,5,2439,528,56575,65066,24970}]}}
2> inet_db:res_option(lookup).
[native,file]
3> inet_db:set_lookup([file,dns]).
ok
4> inet_db:res_option(nameserver).
[]
5> inet:gethostbyname("incomingproxy.devel.sip.su.se", inet6).
{error,timeout}
6> inet_db:add_ns({130,237,162,7}).
ok
7> inet_db:res_option(nameserver).
[{{130,237,162,7},53}]
8> inet:gethostbyname("incomingproxy.devel.sip.su.se", inet6).
{ok,{hostent,"lab08.lab.it.su.se",
              ["incomingproxy.devel.sip.su.se"],
              inet6,
              16,
              [{8193,1712,5,2439,528,56575,65066,24970}]}}

Then:

Erlang (BEAM) emulator version 5.4 [source] [threads:0]

Eshell V5.4  (abort with ^G)
1> inet:gethostbyname("www.erlang.org", inet).
{ok,{hostent,"erlang.org",["www.erlang.org"],inet,4,[{193,180,168,23}]}}
2> inet_db:set_lookup([dns]).
ok
3> inet:gethostbyname("www.erlang.org", inet).
{error,timeout}
4> inet_db:add_ns({130,237,162,7}).
ok
5> inet_db:res_option(nameserver).
[{{130,237,162,7},53}]
6> inet:gethostbyname("www.erlang.org", inet).
{ok,{hostent,"erlang.org",["www.erlang.org"],inet,4,[{193,180,168,23}]}}

I have the following files:

$ cat /etc/nsswitch.conf
hosts:  files dns
$ cat /etc/host.conf
# Auto-generated from nsswitch.conf, do not edit
hosts
bind

But don't ask me why it does work :)

-- 
jimmy



More information about the erlang-questions mailing list