vintage_net v0.6.2 VintageNet.NameResolver View Source

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

Types

Settings for NameResolver

State of the server.

Functions

Returns a specification to start this module under a supervisor.

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

Completely clear out "/etc/resolv.conf".

Set the search domain and nameserver list for the specified interface.

Start the resolv.conf manager.

Stop the resolv.conf manager.

Link to this section Types

Link to this type

ifmap()

View Source
ifmap() :: %{domain: String.t(), nameservers: [String.t()]}

Settings for NameResolver

Link to this type

state()

View Source
state() :: %{ifname: String.t(), ifmap: ifmap()}

State of the server.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

clear(ifname)

View Source
clear(String.t()) :: :ok

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

Link to this function

clear_all()

View Source
clear_all() :: :ok

Completely clear out "/etc/resolv.conf".

Link to this function

setup(ifname, domain, nameservers)

View Source
setup(String.t(), String.t(), [String.t()]) :: :ok

Set the search domain and nameserver list for the specified interface.

This replaces any entries in the /etc/resolv.conf for this interface.

Start the resolv.conf manager.

Stop the resolv.conf manager.