[erlang-questions] inet:gethostbyname issue

Michael McDaniel erlangy@REDACTED
Sat Aug 22 00:26:55 CEST 2009


On Fri, Aug 21, 2009 at 11:40:14AM -0700, Yogish Baliga wrote:
> erl -name baliga@REDACTED
> 1> inet:gethostbyname("foo").
> {ok, {hostent, "foo"....}}
> 
> erl 
> 1> inet:gethostbyname("foo").
> {ok, {hostent, "foo.example.com"...}}
> 
> When erlang node is started with long node name, inet:gethostbyname/1 return short hostname. But starting erlang node with short node name or no node name, inet:gethostbyname/1 return full hostname.
> 
> Any fix for this?
> 
> Thanx,
> -- baliga
> 
> 
>  
> "Point of view is worth 80 IQ points" --Alan Kay
> 
> http://dudefrommangalore.blogspot.com/
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  inet:gethostbyname("delora").  

  works same for me however I started ...


mmcdanie@REDACTED:~/misc/src/erlang/erlview$ uname -a
Linux delora 2.6.24-24-386 #1 Tue Jul 7 19:12:52 UTC 2009 i686 GNU/Linux


mmcdanie@REDACTED:~/misc/src/erlang/erlview$ erl
Erlang R13B01 (erts-5.7.2) [rq:1] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.7.2  (abort with ^G)
1> inet:gethostbyname("delora").
{ok,{hostent,"delora.autosys.us",
             ["localhost.localdomain","localhost","delora"],
             inet,4,
             [{127,0,0,1}]}}
2> q().
ok
3>


mmcdanie@REDACTED:~/misc/src/erlang/erlview$ erl -sname fu
Erlang R13B01 (erts-5.7.2) [rq:1] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.7.2  (abort with ^G)
(fu@REDACTED)1> inet:gethostbyname("delora").
{ok,{hostent,"delora.autosys.us",
             ["localhost.localdomain","localhost","delora"],
             inet,4,
             [{127,0,0,1}]}}
(fu@REDACTED)2> q().
ok
(fu@REDACTED)3> 


mmcdanie@REDACTED:~/misc/src/erlang/erlview$ erl -name fu
Erlang R13B01 (erts-5.7.2) [rq:1] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.7.2  (abort with ^G)
(fu@REDACTED)1> inet:gethostbyname("delora").
{ok,{hostent,"delora.autosys.us",
             ["localhost.localdomain","localhost","delora"],
             inet,4,
             [{127,0,0,1}]}}
(fu@REDACTED)2> q().
ok
(fu@REDACTED)3>


mmcdanie@REDACTED:~/misc/src/erlang/erlview$ erl -name fu@REDACTED
Erlang R13B01 (erts-5.7.2) [rq:1] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.7.2  (abort with ^G)
(fu@REDACTED)1> inet:gethostbyname("delora").
{ok,{hostent,"delora.autosys.us",
             ["localhost.localdomain","localhost","delora"],
             inet,4,
             [{127,0,0,1}]}}
(fu@REDACTED)2> 



~Michael


More information about the erlang-questions mailing list