Skip to content

Instantly share code, notes, and snippets.

@wojtekmach
Forked from nirev/inetrc
Created October 8, 2020 20:03
Show Gist options
  • Save wojtekmach/f93beaf1f61136df28c697df848feb55 to your computer and use it in GitHub Desktop.
Save wojtekmach/f93beaf1f61136df28c697df848feb55 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}.
@gordalina
Copy link

Add {inet6, true}. to support resolving ipv6 addresses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment