Re: openresolv enabled status
Roy Marples
Tue Feb 02 14:08:06 2021
Hi Petr
On 02/02/2021 13:09, Petr Menšík wrote:
I am looking for simple way, how to check whether it is enabled.
...
I think dhclient or any VPN implementation should not try to parse
resolvconf.conf file. Is there good way I haven't spotted yet?
How is it used by existing software?
From an applications perspective such as Network Manager, dhcpcd or OpenVPN,
there is no such check other than "does /sbin/resolvconf exist?"
resolv="nameserver 1.2.3.4"
if [ -x /sbin/resolvconf ]; then
echo "$resolv" | /sbin/resolvconf -a interface.foo
else
echo "$resolv" > /etc/resolv.conf
fi
If resolvconf is present, it is assumed to be working.
It's been like so ever since the original Debian implementation and I've not
seen a good reason to change this.
To "disable" openresolv you either remove it or set resolv_conf_passthrough=YES
in resolvconf.conf which has the same effect as just writing directly to
/etc/resolv.conf
Roy
Archive administrator: postmaster@marples.name