[erlang-questions] detection of hostname

Attila Rajmund Nohl <>
Wed Oct 24 11:18:53 CEST 2012

2012/10/24 Vlad Dumitrescu <>:
> Thank you Raimo for the explanation!
> My problem is that people will fiddle with the settings when getting
> started with Erlang programming, until it works. But when starting
> Eclipse, we have to be able to handle many different cases of
> misconfiguration (legitimate or not), with no good way to let the user
> configure anyhting. Hopefully, it is fixed now, in the latest erlide
> nightly builds. Fortunately, this won't be a problem anymore in the
> near future.
> I am considering writing (and publishing) a script that would detect
> what kind of Erlang communication is possible on a certain machine.
> The script could say "Sorry buddy, you can't use long names on this
> machine at all" or "Please add 'foo' to /etc/hosts to let short names
> work". Whenever people discover some new edge case on their machines,
> they can update the script. Maybe it would be useful to distribute
> with OTP?

I'm not sure how feasible it is. For example, the "Add 'foo' to
/etc/hosts" advice would not work at all if the operating system
doesn't use the /ets/hosts file for name resolving, for example on
Linux the /etc/nsswitch.conf file has a line like this:

hosts: dns

In an ideal world, you should only add a line "Turn to your system
administrator to properly configure your computer" to the
documentation. However, if there's no competent system administrator,
you're screwed even if you try to add a "crash course in system
administration" to your documentation or try to write a system
administrator script.

More information about the erlang-questions mailing list