[erlang-questions] : : [SOLVED] Can't set long node name on windows
Fri Jul 6 22:21:27 CEST 2007
"Dmitrii 'Mamut' Dimandt" <> wrote:
>I should really be careful when reading books :) :
> "We can also use -sname on two different machines when they are
> on the same subnet. Using -sname is also the only method that will
> work if no DNS service is available."
Uh, unfortunately basically everything in that quote is wrong. -name vs
-sname is a matter of host/domain names, a concept that is quite
orthogonal to the concept of subnets. And -name works just fine without
DNS, as long as you put fully-qualified names in /etc/hosts or whatever
you're using. The erl(1) man page has it right of course, but is maybe a
The important thing is that the hostname part of a node name must be
unique (among hosts), predictable, and usable by all involved. If your
Windows box thinks that its name is foo.WORKGROUP, while your Unix box
thinks that the Windows box is called foo.your.domain, and has no idea
how to reach a host called foo.WORKGROUP, you will have problems. In
some cases they may agree on the "foo" part, which is where -sname helps
(at the cost of messing things up when you want foo.example.org and
foo.example.com to be able to communicate). But the Windows box may
actually think that its name is DMITRIIS_COMPUTER, a name that isn't
known by anything outside (at best) the bunch of Windows boxes on your
The clear and obvious way out of this mess is "everything should use
DNS", which amazingly still seems to be a problem in the Windows world.
>Apart from that, Kirill Zaborski suggested that I directly write
> So I ran
> erl -name
This is actually quite a good workaround when you have a "Windows mess"
- or for that matter a private home network where you can't be bothered
to set up DNS or even distribute hosts files. Using IP addresses clearly
fulfills the unique&predictable&usable requirement. Unfortunately it's
not documented that you can specify the hostname part at all with -name,
let alone that the IP address can be used for it (I think at least the
latter may actually be an "accidental" feature).
The downside is that there is zero sanity check on the hostname part,
you can give anything you want there (whether name or IP address), and
so can easily create a different kind of mess.
More information about the erlang-questions