I'm using Network Manager (1.18.0-1) on the Arch Linux system where
resolvconf
is also present (from openresolv
which is a base package netctl
dependecy).
When I'm connecting to the VPN server via NetworkManager I'm experiencing an issue with lasting DNS record after disconnecting the VPN. I partially found why:
- after connection the NetworkManager process includes VPN nameserver in the
resolv.conf
- regarding to
/etc/ppp/ip-up.d/00-dns.sh
(below) and validUSEPEERDNS=1
theresolvconf
is called; it will make backup of theresolv.conf
and replace with own nameserver record - after VPN disconnecting
/etc/ppp/ip-down.d/00-dns.sh
callsresolvconf
to delete the nameserver record and recover theresolv.conf
fromresolv.conf.bak
where is (at this time) unreachable nameserver record
The dirty hotfix is to disable /etc/ppp/ip-up.d/00-dns.sh
(or just comment-out the /usr/bin/resolvconf ...
line). I don't want to uninstall openresolv
because it will break a netctl
dependency and I want this base package too.
Since NetworkManager is not a "stock" networking tool in Arch Linux I'm not sure if this is a kind of bug or what settings am I missing. What would be a correct way how to solve it?
/etc/ppp/ip-up.d/00-dns.sh:
#!/bin/sh
if [ "$USEPEERDNS" = "1" -a -f /etc/ppp/resolv.conf ]; then
if [ -x /usr/bin/resolvconf ]; then
/usr/bin/resolvconf -a ${IFNAME} </etc/ppp/resolv.conf
else
[ -e /etc/resolv.conf ] && mv /etc/resolv.conf /etc/resolv.conf.backup.${IFNAME}
mv /etc/ppp/resolv.conf /etc/resolv.conf
chmod 644 /etc/resolv.conf
fi
fi