[erlang-questions] net_kernel:start oddity

Tuncer Ayaz tuncer.ayaz@REDACTED
Sun Feb 8 18:29:21 CET 2015

On Fri, Feb 6, 2015 at 11:27 PM, David Welton wrote:
> Hi,
> > I'm not sure about this, but I think that the problem is that the
> > node names must be consistent in their use of node names with or
> > without FQDN (in net_kernel:start). The recommended way is to
> > always use it. If my memory serves me right, the issue is
> > traceable to epmd, that saves the node name as received from
> > net_kernel:start, and when you try to connect with a different
> > name, it's not found.
> If I do epmd -names, it just shows me:
> name bar at port 51210
> name foo at port 38616
> Even though they're registered in different ways.
> Still though, it does sound plausible.
> > In short, always use a node name with a full FQDN when using long names.
> What if you don't know the domain name ahead of time? To me, it
> seems like there is something behaving oddly. If nothing else,
> perhaps some additional documentation is needed.
> http://erlang.org/doc/man/erl.html says that you use the FQDN with
> -name, but it does work fine without it.
> http://erlang.org/doc/man/net_kernel.html hints at the fact that the
> atom you pass it should just be the node name sans the host part.
> Perhaps that should be made more explicit in the documentation of
> the start function.
> Still though, I'm curious what's actually going on underneath to
> cause the problem I'm seeing.

You might try tracing net_kernel:create_hostpart/2 plus
inet_db:gethostname/0 and continue from there.

More information about the erlang-questions mailing list