Skip to content

Instantly share code, notes, and snippets.

@nirev
Created October 8, 2020 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nirev/230c616f01b86d3ad9b871af41695526 to your computer and use it in GitHub Desktop.
Save nirev/230c616f01b86d3ad9b871af41695526 to your computer and use it in GitHub Desktop.
Configuring Erlang inet
%% -- ERLANG INET CONFIGURATION FILE --
%% https://erlang.org/doc/apps/erts/inet_cfg.html
%% use it by setting the following envvar:
%% export ERL_INETRC="/path/to/this-file"
%%
%% read and monitor nameserver config from here
{resolv_conf, "/etc/resolv.conf"}.
%% increase cache size
{cache_size, 2000}.
%% specify lookup method
{lookup, [dns, native, file]}.
%% how often (in milliseconds) the resolver cache for inet_res(3) is refreshed (expired DNS records are deleted). Defaults to 1 hour.
%% set to 10 minutes = 1000 * 60 * 10 = 600_000
{cache_refresh, 600000}.
%% time to wait until retry (in milliseconds) for DNS queries made by inet_res
{timeout, 500}.
%% number of DNS queries inet_res will try before giving up
{retry, 3}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment