[erlang-patches] patch: Allow the erlang nodename host part to differ from the hostname

Ulf Wiger <>
Sat May 8 13:15:49 CEST 2010

On 05/08/2010 12:02 PM, Björn Gustavsson wrote:
> On Fri, May 7, 2010 at 5:50 PM, Ulf Wiger
> <> wrote:
>> http://github.com/uwiger/otp/tree/epmd_fullnames
> Thanks! Included in 'pu'.

On the topic of test suites, I did look into writing some tests
to verify the functionality, but at first sight, it was not obvious
how to do this. Thinking about it some more, perhaps the
test_server functions to start slave/peer nodes will be adequate?

This is how I went about connecting two nodes on my laptop
(hostname: uwiger-laptop).

1. Start the first node:
   erl -sname  -epmd_fullnames true

2. Start the second node:
   erl -sname  -epmd_fullnames true

3. In the second node:
   1> inet_db:add_host({127,0,0,1}, ["host1"]).
   2> inet_db:set_lookup([file, native]).
   3> net:ping().

Running epmd with the -debug flag helps illustrate what's happening.

If the -epmd_fullnames flag is omitted, an error will be issued
when trying to start the second node, as the Name parts are the
same on both nodes.

The above also works with -name  instead of
-sname. Then, the call to inet_db:add_host/2 must be:
inet_db:add_host({127,0,0,1}, ["host1.somedomain"]) instead.

There are other ways to configure the name lookup, as documented in
the ERTS User's Guide.

Re. the documentation - I didn't change it since it is not documented
even today that you can use -sname  in the first place, so
I thought that perhaps the feature could be included as an undocumented
feature to begin with? The ambition level of the documentation could be
discussed - ranging from some terse descriptions of each individual
option to a chapter in a User's Guide.

First, perhaps, a decision could be made about whether to include the
feature at all - not least because there is a migration aspect to
consider, should the fullnames option become a future default.

Ulf W



Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG SOLUTIONS LTD.


More information about the erlang-patches mailing list