[erlang-questions] inet:gethostbyname question

Yogish Baliga <>
Tue Jan 19 06:21:06 CET 2010


"Point of view is worth 80 IQ points" --Alan Kay

http://dudefrommangalore.blogspot.com/





________________________________
From: Raimo Niskanen <>
To: Yogish Baliga <>; 
Sent: Mon, January 18, 2010 7:24:18 AM
Subject: Re: [erlang-questions] inet:gethostbyname question

On Fri, Jan 15, 2010 at 01:24:28PM -0800, Yogish Baliga wrote:
> Strange thing is happening with inet:gethostbyname(inet_db:gethostname()) in R13 release.

Which R13 release is it? The code involved was
extensively rewritten in R13B02.

Using latest version of R13.

And what does inet_db:gethostname() acutally return?


inet_db:gethostname() return gw06

> 
> inet_db:res_option(lookup).
> [dns,native,file].
> inet:gethostbyname(inet_db:gethostname())
> {error,nxdomain}
> inet_db:set_lookup([dns]).
> inet:gethostbyname(inet_db:gethostname())
> {ok,{hostent,"gw06",[],inet,4,[{127,0,0,1}]}}
> 
> Having lookup method to 3 elements [dns,native,file] is not working. If I set it to only "dns", it is working. Also noticed that
> 
> inet_db:res_option(search).
> []
> inet_db:res_option(domain).
> "example.com"
> 
> Then I execute,
> 
> inet_config:init().
> 
> This function is called by inet_db:start_link(), which is called by kernel:init().
> 
> After executing inet_config:init(),
> 
> inet_db:res_option(search).
> ["sk1.example.com"].
> inet_db:res_option(domain).
> "example.com".
> 
>  
> After executing inet_config:init(), order of lookup methods doesn't matter. As long as I have dns in the list, it works.
> 
> inet:gethostbyname(inet_db:gethostname()).
> {ok,{hostent,"gw06.sk1.example.com",[],inet,4,[{127,0,0,1}]}}
> 
> Any idea, why inet_config:init() called by kernel->inet_db:start_link() is not working as expected?
> 
> Thanx,
> -- baliga
> 
> "Point of view is worth 80 IQ points" --Alan Kay
> 
> http://dudefrommangalore.blogspot.com/
-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org


More information about the erlang-questions mailing list