[erlang-questions] inet configuration vs. name and sname

Felix Gallo <>
Wed Aug 31 06:13:25 CEST 2016


I would like to force my node's name to be in IPV4 format, e.g., '
", rather than any hostname-related nameserved alternative.  I
would expect this to be possible, because erlang frequently operates in
constrained environments and embedded environments where DNS is a luxury,
etc., etc.

Reading http://erlang.org/doc/apps/erts/inet_cfg.html I get the strong
impression that this is further supposed to be possible.  For example, one
might construct an inet_config file that looks like this:

%% erlang inetrc
{resolv_conf, ""}. %% do not use a resolv.conf file.
{file, hosts, "/dev/null"}.  %% use a null hosts file.  Note: "" throws
weird error.
{hosts_file, ""}. %% further, don't keep tabs on that hosts file.
{cache_size, 0}. %% never care what happens with DNS caching.
{lookup, [file]}.  %% only look up hostnames through the empty hosts file;
no dns, no native.
clear_hosts.  %%  No hosts.  Are we clear on this erlang?  Are we?
clear_ns. %% No nameservers.  None!  You cannot look up names.
clear_search.  %% No search domain.

and yet,

$ erl -kernel inetrc '"./erl_inetrc"' -name mynode
Erlang/OTP 19 [erts-8.0] [source-6dc93c1] [64-bit] [smp:4:4]
[async-threads:10] [hipe] [kernel-poll:false]

Eshell V8.0  (abort with ^G)
()1> inet:get_rc().
[{domain,"att.net"},
 {resolv_conf,[]},
 {hosts_file,[]},
 {cache_size,0},
 {lookup,[file]}]

note that the name of the machine ('spatula') and domain ('att.net') have
nevertheless been found out; and

$ erl -kernel inetrc '"./erl_inetrc"' -sname mynode
Erlang/OTP 19 [erts-8.0] [source-6dc93c1] [64-bit] [smp:4:4]
[async-threads:10] [hipe] [kernel-poll:false]

Eshell V8.0  (abort with ^G)
()1> inet:get_rc().
[{resolv_conf,[]},
 {hosts_file,[]},
 {cache_size,0},
 {lookup,[file]}]

This makes me sad.  Am I missing something or is it not possible to force
the  part of a node's name to be simply dotted quads?

F.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160830/e9c0b176/attachment.html>


More information about the erlang-questions mailing list