[erlang-bugs] inet_res:getbyname

Raimo Niskanen raimo+erlang-bugs@REDACTED
Thu Sep 6 09:28:23 CEST 2007


Well, since this resolver is kind of deprecated; not really - we have
paying customers using it, but almost deprecated. The native resolver
is the one we want everyone to use since it calls the OS resolver
and therefore should be perfectly bug compatible.

Anyway, we have no strong reasons to put a lot of work into
inet_res. But if it behaves strangely and we can fix it
easily we will do it.

I took a quick look into ets:tab2list(inet_db) for both
-sname and -name and it seems res_domain, res_ns and
res_search does not get initialized if started with
-sname. It seems my host resolver configuration file is
not read (/etc/resolv.conf). This rings a bell about
cleanups we did about which host configuration files
are read at startup (/etc{resolv.conf,nsswitch.conf,
hosts,host.conf,irs.conf,...}. It was a mess and very bug prone.
The idea is that the native resolver does it right
so we shall use it.

I have to talk to some people...

Anyway, this means there are workarounds, at least using
the infamous inetrc file, to set an inet_res configuration of your own.



On Wed, Sep 05, 2007 at 07:01:57PM -0500, Matthew O'Gorman wrote:
> inet_res:getbyname fails unless started with -name
> 
>  erl
> 
> Erlang (BEAM) emulator version 5.5.5 [source] [64-bit]
> [async-threads:0] [hipe] [kernel-poll:false]
> 
> 
> 
> Eshell V5.5.5  (abort with ^G)
> 
> 1> inet_res:getbyname("_xmpp-server._tcp.digium.com",srv).
> 
> {error,timeout}
> 
> 2>
> 
> 
> 
>  erl -sname matt
> 
> Erlang (BEAM) emulator version 5.5.5 [source] [64-bit]
> [async-threads:0] [hipe] [kernel-poll:false]
> 
> 
> 
> Eshell V5.5.5  (abort with ^G)
> 
> (matt@REDACTED)1> inet_res:getbyname("_xmpp-server._tcp.digium.com",srv).
> 
> {error,timeout}
> 
> (matt@REDACTED)2>
> 
> 
> 
> erl -name matt
> 
> Erlang (BEAM) emulator version 5.5.5 [source] [64-bit]
> [async-threads:0] [hipe] [kernel-poll:false]
> 
> 
> 
> Eshell V5.5.5  (abort with ^G)
> 
> (matt@REDACTED)1>
> inet_res:getbyname("_xmpp-server._tcp.digium.com",srv).
> 
> {ok,{hostent,"_xmpp-server._tcp.digium.com",
> 
>              [],
> 
>              srv,
> 
>              1,
> 
>              [{5,0,5269,"jabber.digium.com"}]}}
> 
> (matt@REDACTED)2>
> 
> 
> 
> 
> This seems to have existed since r10b i was wondering if there are any
> intentions on ever fixing it?
> 
> Mog
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-bugs

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-bugs mailing list