openresolv-discuss

Stuck On Trying to Get resolvconf to Update /etc/resolv.conf

Jeremy Hansen

Thu Nov 16 03:01:39 2017

I'm struggling with what I feel should be something really simple. I am
attempting to use resolvconf to update my resolv.conf when I connect to a
VPN using openvpn. I have installed your script on Slackware 14.2 using the
SlackBuild <https://slackbuilds.org/repository/14.2/network/openresolv/>
available on https://slackbuilds.org, passing the OPENVPN=yes option to it
so it will include a script (update-resolv-conf) to easily run your script
when the VPN connection status changes. That script seems to be operating
fine, but still wasn't updating my /etc/resolv.conf, so I tried running the
commands normally.

I can get resolvconf to store the information for both devices (eth0 and
tun0) and can verify it using resolvconf -l, however, I can't get it to
update the /etc/resolv.conf. I feel like I'm missing something easy, but I
can't find it.

I've tried variations of options, always including the -a tun0.inet, and
then trying the -u to force updating all "subscribers", as well as both the
-p and the -x options for private and exclusive. All seem to update
resolvconf's info, verified using resolvconf -l, but nothing seems to
update /etc/resolv.conf

As can be seen from my output below, my eth0 device is getting its address
via dhcpcd.

root@craven-moorhead:~# cat /etc/resolv.conf
# Generated by dhcpcd from eth0.dhcp
# /etc/resolv.conf.head can replace this line
domain home
nameserver 10.0.0.1
# /etc/resolv.conf.tail can replace this line
root@craven-moorhead:~# resolvconf -l
# resolv.conf from eth0.dhcp
# Generated by dhcpcd from eth0.dhcp
domain home
search home
nameserver 10.0.0.1

root@craven-moorhead:~# echo "nameserver 8.8.8.8" | resolvconf -u -a
tun0.inet
root@craven-moorhead:~# resolvconf -l
# resolv.conf from tun0.inet
nameserver 8.8.8.8

# resolv.conf from eth0.dhcp
# Generated by dhcpcd from eth0.dhcp
domain home
search home
nameserver 10.0.0.1

root@craven-moorhead:~# cat /etc/resolv.conf
# Generated by dhcpcd from eth0.dhcp
# /etc/resolv.conf.head can replace this line
domain home
nameserver 10.0.0.1
# /etc/resolv.conf.tail can replace this line

I'd appreciate any help you can provide with this, and I'd be happy to
answer any questions you may have. Hopefully I'm just missing something
obvious.
Jeremy

Follow-Ups:
Re: Stuck On Trying to Get resolvconf to Update /etc/resolv.confRoy Marples
Archive administrator: postmaster@marples.name