This section describes how the Erlang runtime system is configured for IP communication. It also explains how you can configure it for your needs by a configuration file. The information is primarily intended for users with special configuration needs or problems. There is normally no need for specific settings for Erlang to function properly on a correctly IP-configured platform.
When Erlang starts up it reads the Kernel variable
Notice that the use of an
A second way to specify the configuration file is to set
environment variable
Notice that the Kernel variable
If no user configuration file is specified and Erlang is started
in non-distributed or short name distributed mode, Erlang uses
default configuration settings and a native lookup method that
works correctly under most circumstances. Erlang reads no
information from system
If Erlang is started in long name distributed mode, it needs to
get the domain name from somewhere and reads system
Native lookup (system calls) is always the default resolver method.
This is true for all platforms, except VxWorks and OSE Delta where
On Windows platforms, Erlang searches the system registry rather than looks for configuration files when started in long name distributed mode.
Erlang records the following data in a local database if found in system
This data can also be specified explicitly in the user
configuration file. This file is to contain lines
of configuration parameters (each terminated with a full stop).
Some parameters add data to the configuration (such as host
and nameserver), others overwrite any previous settings
(such as domain and lookup). The user configuration file is always
examined last in the configuration process, making it possible
for the user to override any default values or previously made
settings. Call
The valid configuration parameters are as follows:
Specify a system file that Erlang is to read configuration data from.
Specify a system file that Erlang is to read resolver
configuration from for the internal DNS client
This can override the configuration parameters
If the file is specified as an empty string
If this parameter is not specified, it defaults to
Specify a system file that Erlang is to read resolver configuration from for the internal hosts file resolver, and monitor for changes, even if it does not exist. The path must be absolute.
These host entries are searched after all added with
If the file is specified as an empty string
If this parameter is not specified, it defaults to
Specify a system registry that Erlang is to read configuration
data from.
Add host entry to the hosts table.
Set domain name.
Add address (and port, if other than default) of the primary
nameserver to use for
Add address (and port, if other than default) of the secondary
nameserver for
Add search domains for
Specify lookup methods and in which order to try them. The valid methods are as follows:
The lookup method
Set the resolver cache size. Defaults to 100 DNS records.
Set how often (in milliseconds) the resolver cache for
Set the time to wait until retry (in milliseconds) for DNS queries
made by
Set the number of DNS queries
Tells the DNS client
Tells the DNS client
Sets the EDNS version that
Sets the allowed UDP payload size
Tell Erlang to use another primitive UDP module than
Tell Erlang to use another primitive TCP module than
Clear the hosts table.
Clear the list of recorded nameservers (primary and secondary).
Clear the list of search domains.
Assume that a user does not want Erlang to use the native lookup method,
but wants Erlang to read all information necessary from start and use
that for resolving names and addresses. If lookup fails, Erlang
is to request the data from a nameserver (using the Erlang
DNS client, set to use EDNS allowing larger responses).
The resolver configuration is updated when
its configuration file changes. Also, DNS records
are never to be cached. The user configuration file
(in this example named
%% -- ERLANG INET CONFIGURATION FILE -- %% read the hosts file {file, hosts, "/etc/hosts"}. %% add a particular host {host, {134,138,177,105}, ["finwe"]}. %% do not monitor the hosts file {hosts_file, ""}. %% read and monitor nameserver config from here {resolv_conf, "/usr/local/etc/resolv.conf"}. %% enable EDNS {edns,0}. %% disable caching {cache_size, 0}. %% specify lookup method {lookup, [file, dns]}.
And Erlang can, for example, be started as follows: