erlang resolver and resolv.conf

Alexey Shchepin <>
Mon Feb 7 14:58:53 CET 2005


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