erlang resolver and resolv.conf

UAB L/K Peter Andersson peppe@REDACTED
Mon Feb 7 09:25:02 CET 2005


Hi Alexey,

I think the comment beginning on line 65 explains it:

    %% Note: In shortnames (or non-distributed) mode we don't need to
know
    %% our own domain name. In longnames mode we do and we can't rely on 
    %% the user to provide it (by means of inetrc), so we need to look 
    %% for it ourselves.

Best regards, 
Peppe


Alexey Shchepin wrote:
> 
> Hi!
> 
> >From lib/kernel/src/inet_config.erl:
> 
> do_load_resolv({unix,Type}, longnames) ->
>     %% The Etc variable enables us to run tests with other
>     %% configuration files than the normal ones
>     Etc = case os:getenv("ERL_INET_ETC_DIR") of
>               false -> ?DEFAULT_ETC;
>               _EtcDir ->
>                   _EtcDir
>           end,
>     load_resolv(filename:join(Etc,"resolv.conf"), resolv),
>     ...
> 
> Other branches of this function doesn't have loading of /etc/resolv.conf.
> I.e. resolv.conf is loaded on unixes only when erl is runned with -name option
> (not the second argument to do_load_resolv), and with short name or without any
> name reolv.conf is completely ignored.  Can someone describe reasons of such
> behaviour?
> 
> Thanks!



More information about the erlang-questions mailing list