No nameservers in R10B-0

Raimo Niskanen raimo@REDACTED
Fri Oct 15 09:12:49 CEST 2004


Well,

we changed to [native,file] since we finally got a stable working solution
on all other platforms of using the host OS resolver functions. That does
sound as it should not be so difficult, but the problem was to work around
multithreading issues. The [native] solution uses a pool of external
port programs that does the actual resolver lookups.

The [native] lookup option is the right(tm) way to do it since then all
applications on the host resolves names the same way.

The [dns] option uses an internal Erlang-only dns client that might 
behave slightly different from the one in the host OS.

So, I would say that you probably have a misconfigured host and
the previous Erlang resolver options worked arount that. At least
for IPv6.

If the nameserver does not get set now, but got set in R9C, I do
not know why. Is that the case? 



ft@REDACTED (Fredrik Thulin) writes:

> 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

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list