Re: Network Manager, openvpn & DNS
> DNS server […] is added […] whereas I'd like it to replace
Hello,
By default, NetworkManager (see NetworkManager.conf, 'dns' entry)
updates the DNS entries by calling resolvconf/openresolv or by
pudating the resolv.conf file directly.
resolvconf/openresvol does not know how to override the domain
entries. It always prepend the new nameservers to the current list.
It seems that the behaviour is the same when NetworkManager updates
resolv.conf directly.
openresolv has an options (-x for exclusive) which can be used to
override the resolv.conf configuration:
echo "nameserver 80.67.188.188" | resolvconf -a tun0 -x
You should be able to use the NetworkManager hooks
(/etc/NetworkManager/dispatcher.d/vpn-pre-{up,down}) to trigger this
with something like:
(for ns in $IP6_NAMESERVERS $IP4_NAMESERVERS ; do
echo "nameserver $ns"
done) | resolvconf -a "$DEVICE_IFACE" -x
(Not tested.)
--
Gabriel
Reply to: