nerves_network v0.3.1 Nerves.Network.Resolvconf

This module manages the contents of “/etc/resolv.conf”. This file is used by the C library for resolving domain names and must be kept up-to-date as links go up and down. This module assumes exclusive ownership on “/etc/resolv.conf”, so if any other code in the system tries to modify the file, their changes will be lost on the next update.

Link to this section Summary

Functions

Clear all entries in “/etc/resolv.conf” that are associated with the specified interface

Completely clear out “/etc/resolv.conf”

Return the default resolve.conf path for this system

Set the search domain for non fully qualified domain name lookups

Set the nameservers that were configured on this interface. These will be added to “/etc/resolv.conf” and replace any entries that were previously added for the specified interface

Set all of the options for this interface in one shot. The following options are available

Link to this section Functions

Link to this function clear(pid, ifname)

Clear all entries in “/etc/resolv.conf” that are associated with the specified interface.

Completely clear out “/etc/resolv.conf”.

Link to this function default_resolvconf_path()

Return the default resolve.conf path for this system.

Link to this function set_domain(pid, ifname, domain)

Set the search domain for non fully qualified domain name lookups.

Link to this function set_nameservers(pid, ifname, servers)

Set the nameservers that were configured on this interface. These will be added to “/etc/resolv.conf” and replace any entries that were previously added for the specified interface.

Link to this function setup(pid, ifname, options)

Set all of the options for this interface in one shot. The following options are available:

  • :domain - the local domain name
  • :nameservers - a list of IP addresses of name servers

Options can be specified either as a keyword list or as a map. E.g.,

%{domain: “example.com”, nameservers: [“8.8.8.8”, “8.8.4.4”]}

Link to this function start_link(resolvconf_path \\ "/etc/resolv.conf", opts \\ [])