resolv.conf

From Gentoo Wiki
Jump to: navigation, search

The /etc/resolv.conf file is used to configure hostname resolution. It may be manually configured by the system administrator, or may be automatically populated by various network configuration tools.

NetworkManager

When using NetworkManager, /etc/resolv.conf should be a symlink pointing at /run/NetworkManager/resolv.conf.

systemd-resolved

There are multiple options for setting up a resolv.conf symlink to work with systemd-resolved.

Two main features are supported:

  • Stub resolver: the nameserver is pointed at systemd-resolved, listening on 127.0.0.53. DNS queries are executed by systemd-resolved.
  • Search path: The "search" directive is used to configure default domain names to be used when resolving single-word DNS queries.

The available options/features depend on the version of systemd installed and which target is used for the symlink.

Symlink target Stub resolver Search path < systemd-234 systemd-234/235 >= systemd-236
/run/systemd/resolve/stub-resolv.conf Yes Yes No No Yes
/run/systemd/resolve/resolv.conf No Yes Yes Yes Yes
/lib/systemd/resolv.conf Yes No No Yes Yes
/usr/lib/systemd/resolv.conf Yes No Yes No No

openresolv

The net-dns/openresolv package integrates with several other packages to dynamically update /etc/resolv.conf when network configuration changes occur. When using openresolv, /etc/resolv.conf should be a regular file.