Hi!<div><br></div><div>The inet:gethostname() function returns the name of the system that the node is running on. This is the name that is printed by the hostname command. This persistent configuration data is not stored in the /etc/hosts, but in the /etc/hostname file.</div>
<div><br></div><div>The presence of your hostname in the /etc/hosts file is to ensure that the local system is reachable at the loopback address, if needed.</div><div><br></div><div>If you always want to start a node on localhost and use short names you can use use slave:start("localhost", slave_node, []).</div>
<div><br></div><div>MVH Magnus</div><div><br><div class="gmail_quote">2011/9/26 Ignas Vyšniauskas <span dir="ltr"><<a href="mailto:baliulia@gmail.com">baliulia@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi erlang-questions,<br>
<br>
I have the following behaviour:<br>
<br>
[~]$ erl -sname foobar<br>
Erlang R14B (erts-5.8.1) [source] [64-bit] [smp:4:4] [rq:4]<br>
[async-threads:0] [hipe] [kernel-poll:false]<br>
<br>
Eshell V5.8.1  (abort with ^G)<br>
(foobar@localhost)1> inet:gethostname().<br>
{ok,"pufpuf"}<br>
<br>
Notice the different 'localhost' and 'pufpuf' hostnames.<br>
<br>
I am running Erlang R14B-2 on ArchLinux 3.0.<br>
<br>
[~]$ hostname<br>
pufpuf<br>
<br>
[~]$ cat /etc/hosts<br>
#<ip-address>   <<a href="http://hostname.domain.org" target="_blank">hostname.domain.org</a>>   <hostname><br>
127.0.0.1       localhost.localdomain   localhost    pufpuf<br>
::1             localhost.localdomain   localhost<br>
<br>
Is it normal behaviour? I am using things like:<br>
<br>
{ok, Hostname} = inet:gethostname(),<br>
slave:start(Hostname, slave_node, []).<br>
<br>
which obviously fails under such circumstances.<br>
Is there a different approach to this? Is my system misconfigured?<br>
<br>
/Ignas<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a></blockquote></div></div>