[erlang-questions] : erl: "Can't set long node name!"

John Chandler <>
Thu Jun 19 13:04:12 CEST 2008


On Jun 19, 2008, at 4:20 AM, Raimo Niskanen wrote:
> On Wed, Jun 18, 2008 at 11:39:53PM -0400, John Chandler wrote:
>> Thanks.  I think you may be right.  I'll have to work on how to set
>> this up, because this is a Mac and the Unix networking tools only
>> *sort of* work.  In particular, "hostname" doesn't have a "--long"
>> option.
>
> On a Mac(OS X), `hostname' gives you the fully qualified
> hostname and 'hostname -s' gives the short name. Try
> `man hostname', it works on most platforms.

"hostname" works fine, it just doesn't have the same options
as on Linux.  But if your network needs to be
re-initialized, you can't use "ifconfig blah blah down" and
"ifconfig blah blah up" to accomplish that, you have to do
some GUI hoohah.  But I digress.  On my machine,
"hostname" with or without the "-s" yields a
fully-unqualified hostname.

> Why do you not run short names a'la `erl -sname foo'?

Because I am/was unaware of the option.  I am following an
example in an online article that doesn't mention that those
trying to follow along on a machine that boots up with DHCP
from a consumer-level private-network router will get a
not-entirely-helpful screenful of information and probably
ought to use this other option.

> If you know your hosts DNS domainname you can force
> the node name a'la `erl -name '.
>
> To make `erl -name foo' work, a name lookup of the
> short hostname must return the fully qualified
> hostname. Try from erlang with `inet:gethostbyname("foo").',
> if that does not give you a long hostname as the
> second element of the returned hostent tuple;
> long node names will not work without giving
> a long node name to the -name argument

This makes sense.  I have no particular commitment
to using long node names, as long as I can get nodes
to work properly without them.

>>
>> Static IP may be a bit challenging, or at least laborious, because
>> my machine is a laptop moved relatively frequently to different
>> locations.
>
> It works just as well with dynamic IP, if the name
> resolver (often DNS resolver) returns a fully qualified name.

There is no FQDN that resolves to my laptop, unless I'm
mistaken.

>>
>> And I'm not clear on how to set up a "domain" in the sense you
>> mean.  I  have a couple of them, but they're not DNS'd to my
>> laptop.
>
> If you have no clear domain, use short node names;
> that is what they are for. Long node names are
> only necessary when you have to distinguish between
> different domains.

I think this may be the answer.

>> I wonder if Erlang will evolve to match the way people use
>> computers now (and didn't 10, 20 years ago).
>
> I am afraid computer networking has not changed much
> the last 10, 20 years...

My remark was ill-advised, and I apologize.  Erlang covers
the case I'm concerned with, it's just the article I was
following that didn't.  And I was reading the article in
order to reduce, at least a little, my vast ignorance of
Erlang.

Still, 10, 20 years ago people did not commonly pick up
their computers, take them home, or to work, or to
Charbucks, or to a friend's house, and (reasonably) expect
them to be able to join the local net.  Back in the day, if
you took your workstation to another branch of your large
company, someone would have to add your MAC address to one
NIS map, and give you an IP and a hostname before your
machine would boot properly.

-jmc




More information about the erlang-questions mailing list