[erlang-questions] Inconsistent hostnames

Ryan Stewart <>
Tue Jun 21 21:11:54 CEST 2016


In deploying my erlang app to some new CentOS servers with erlang 18.3, I
came across an oddity in networking. The server's networking config, which
is admittedly messed up, looks something like:
short hostname: bob
long hostname: bob.prod.example.net
domain: example.com

Now when I start erlang with "erl -sname x", net_adm:localhost() returns "
bob.prod.example.net".

However, if I start erlang with "erl -name x", net_adm:localhost() returns "
bob.example.com".

I believe this comes from net_kernel:create_hostpart/2, where it follows
different paths on short vs long node names. On a long node name, it
appears to use short hostname + domain, where on a short node name, it
simply uses the long hostname. That decision appears to trickle through the
rest of the networking libraries.

I understand that we need to fix the config on the server. I just wondered
if this might be considered a bug in erlang as well.

Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160621/60f9835b/attachment.html>


More information about the erlang-questions mailing list