inet configuration vs. name and sname

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

inet configuration vs. name and sname

Felix Gallo-2
I would like to force my node's name to be in IPV4 format, e.g., '[hidden email]", 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)
([hidden email])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)
(mynode@spatula)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 after-the-@-sign part of a node's name to be simply dotted quads?

F.

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: inet configuration vs. name and sname

Gleb Vinogradov
Hi Felix

1. after-the-@-sign part is just result of calling command 'hostname'.
2. Have you tried erl -name [hidden email] ?

Gleb

2016-08-31 11:13 GMT+07:00 Felix Gallo <[hidden email]>:
I would like to force my node's name to be in IPV4 format, e.g., '[hidden email]", 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)
([hidden email])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)
(mynode@spatula)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 after-the-@-sign part of a node's name to be simply dotted quads?

F.

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: inet configuration vs. name and sname

Felix Gallo-2
Hi Gleb -- 

1.  yes, I know gethostname(3) somehow snuck in there despite my best efforts.  The documentation suggested strongly that it wouldn't, though.

I hadn't tried -name '[hidden email]' yet and to my surprise that does seem to work.  That'll work for what I need; thanks!

F.


On Tue, Aug 30, 2016 at 9:49 PM, Gleb Vinogradov <[hidden email]> wrote:
Hi Felix

1. after-the-@-sign part is just result of calling command 'hostname'.
2. Have you tried erl -name [hidden email] ?

Gleb

2016-08-31 11:13 GMT+07:00 Felix Gallo <[hidden email]>:
I would like to force my node's name to be in IPV4 format, e.g., '[hidden email]", 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)
([hidden email])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)
(mynode@spatula)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 after-the-@-sign part of a node's name to be simply dotted quads?

F.

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions




_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions