erlang resolver and resolv.conf

UAB L/K Peter Andersson <>
Mon Feb 7 15:17:24 CET 2005


The idea is that erlang will always use native lookup unless you specify
otherwise explicitly. The fact that resolving does not work properly
when you run erlang in shortname mode implies that networking is not
properly configured in your os. Please read the ERTS User's Guide,
chapter 7. Hopefully that will clearify things.

  /Peppe

Alexey Shchepin wrote:
> 
> Hello, Peter!
> 
> On Mon, 07 Feb 2005 09:25:02 +0100, you said:
> 
>  UL> I think the comment beginning on line 65 explains it:
> 
>  UL>   %% Note: In shortnames (or non-distributed) mode we don't need to know
>  UL>   %% our own domain name. In longnames mode we do and we can't rely on
>  UL>   %% the user to provide it (by means of inetrc), so we need to look
>  UL>   %% for it ourselves.
> 
> But resolv.conf also contains a list of nameservers, and without reading it at
> least inet_res:getbyname doesn't work (always returns {error, timeout}):
> 
> $ erl -name test
> Erlang (BEAM) emulator version 5.4 [source] [hipe] [threads:0]
> 
> Eshell V5.4  (abort with ^G)
> ()1> inet_res:getbyname("_xmpp-server._tcp.jabber.ru", srv).
> {ok,{hostent,"_xmpp-server._tcp.jabber.ru",[],srv,1,[{0,0,5269,"jabber.ru"}]}}
> 
> $ erl -sname test
> Erlang (BEAM) emulator version 5.4 [source] [hipe] [threads:0]
> 
> Eshell V5.4  (abort with ^G)
> ()1> inet_res:getbyname("_xmpp-server._tcp.jabber.ru", srv).
> {error,timeout}



More information about the erlang-questions mailing list