net-dns/openresolv handles /etc/resolv.conf dynamic changes and priority. This is needed as there are several daemons (dhcpcd, ppp, openvpn) that actively rewrites /etc/resolv.conf. This leads to undesired results, as usually only the last settings are preserved.
net-dns/openresolv provides a common interface for /etc/resolv.conf, and is used by sys-apps/openrc, net-misc/dhcpcd, net-misc/openvpn if openresolv package is installed. There is no direct dependency, so you need to install it directly.
Usually once installed nothing should be done, to see it working, watch for resolvconf signature within /etc/resolv.conf.
# Generated by resolvconf search mydomain.com domain.name nameserver 10.10.50.2 nameserver 10.10.50.39 nameserver 192.168.1.1
# resolvconf -l # resolv.conf from vpn0 # Generated by openvpn for interface vpn0 domain mydomain.com nameserver 10.10.50.2 nameserver 10.10.50.39 # resolv.conf from wlan0 # Generated by dhcpcd from wlan0 domain domain.name nameserver 192.168.1.1
Setting Interface Metrics
For example, set vpn interface to have higher priority than other interfaces:
Originally written by: Alon Bar-Lev - 2011-11-17
Authors are people who have worked on this document and have made significant changes to its content. If you have edited this article and wish to add yourself to the authors list please read "Who are Authors".