LinuxCommandLibrary

resolvconf

TLDR

Update DNS configuration

$ resolvconf -u
copy
Add interface configuration
$ echo "nameserver 8.8.8.8" | resolvconf -a [eth0]
copy
Delete interface configuration
$ resolvconf -d [eth0]
copy
List interfaces
$ resolvconf -l
copy
Show current resolv.conf
$ cat /etc/resolv.conf
copy

SYNOPSIS

resolvconf [-a interface] [-d interface] [-u] [options]

DESCRIPTION

resolvconf manages /etc/resolv.conf dynamically. It aggregates DNS configurations from multiple sources.
Interfaces register their DNS servers. DHCP, VPN, and NetworkManager contribute.
Priority ordering determines final configuration. Earlier interfaces have higher priority.
The generated resolv.conf combines all inputs. Head and tail files add static content.
Deletion removes interface contribution. Useful when connection terminates.

PARAMETERS

-a INTERFACE

Add/update interface config.
-d INTERFACE
Delete interface config.
-u
Update resolv.conf.
-l
List interfaces.
-i PATTERN
Include interfaces.
-x PATTERN
Exclude interfaces.
-p
Show head file.

CAVEATS

May conflict with systemd-resolved. Distribution implementations vary. Some use openresolv, others resolvconf.

HISTORY

resolvconf was created to handle dynamic DNS configuration from multiple network sources. Various implementations exist including openresolv and the Debian resolvconf package.

SEE ALSO

Copied to clipboard