<div dir="ltr"><div><div><div><div><div><div>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:<br></div>short hostname: bob<br></div>long hostname: <a href="http://bob.prod.example.net">bob.prod.example.net</a><br></div>domain: <a href="http://example.com">example.com</a><br><br></div>Now when I start erlang with "erl -sname x", net_adm:localhost() returns "<a href="http://bob.prod.example.net">bob.prod.example.net</a>".<br><br>However, if I start erlang with "erl -name x", net_adm:localhost() returns "<a href="http://bob.example.com">bob.example.com</a>".<br><br></div>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.<br><br></div><div>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.<br><br></div><div>Ryan<br></div></div>