No nameservers in R10B-0

Fredrik Thulin ft@REDACTED
Fri Oct 15 00:09:57 CEST 2004


Hi

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).

It appears to be because of two reasons :

1) inet_db's lookup list changed from [file, dns] to [native, file].
2) inet_db does not know any nameservers to ask!

If I use inet_db:set_lookup() to include 'dns' in the lookup list AND 
add a nameserver using inet_db:add_ns() then it actually works again. 
Note that this is on the same host, with the same /etc/resolv.conf, 
that works just fine with R9C-0. What happened?

R10B-0 :

Eshell V5.4  (abort with ^G)
1> inet:gethostbyname("incomingproxy.devel.sip.su.se", inet6).
{error,nxdomain}
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}]}}
9>

R9C-0 :

Eshell V5.3  (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).
[file,dns]
3> inet_db:res_option(nameserver).
[{{130,237,162,7},53},{{130,237,200,7},53}]
4>

Also, this means that IPv4 address resolving using lookup method 'dns' 
is ALSO broken for me on R10B-0. Luckily, 'native' for some reason 
handles queries for A-records, but not AAAA.

R10B-0 IPv4 query with 'native' and then 'dns' :

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>

I would very much like to know how to remedy this, since I already have 
IPv6 support in my application (Yxa SIP server/stack), but it does not 
get used if the resolving never results in IPv6 addresses.

/Fredrik



More information about the erlang-questions mailing list