vintage_net v0.2.1 VintageNet.NameResolver

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()
ifmap() :: %{domain: String.t(), nameservers: [String.t()]}

Settings for NameResolver

Link to this type

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

State of the server.

Link to this section Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

clear(ifname)
clear(String.t()) :: :ok

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

Link to this function

clear_all()
clear_all() :: :ok

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

Link to this function

setup(ifname, domain, nameservers)
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.

Link to this function

start_link(args)
start_link(keyword()) :: GenServer.on_start()

Start the resolv.conf manager.

Link to this function

stop()
stop() :: :ok

Stop the resolv.conf manager.