LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   dhcpcd not updating resolv.conf when using resolvconf (https://www.linuxquestions.org/questions/slackware-14/dhcpcd-not-updating-resolv-conf-when-using-resolvconf-4175615491/)

LQSlacker 10-11-2017 07:34 PM

dhcpcd not updating resolv.conf when using resolvconf
 
I'm running 14.2 x64 with only Openbox, and I'm only using dhcpcd, and I've installed openresolv to use resovlconf with update-resolv-conf for OpenVPN.

When I connect to an OpenVPN server I see that resolv.conf is updated with the VPNs DNS, but when I disconnect resolv.conf is empty and doesn't get updated back with dhcpcd.

I've read some things regarding this, that it doesn't just happen automatically like when using a network client that takes care of this and does the updating for you.

So I want to figure out how I can stay away from using the NetworkManager or wicd and just use only dhcpcd and have resolv.conf updated, when I disconnect from the VPN?

Right now when I disconnect resolv.conf is empty;

# Generated by resolvconf

Thanks

LQSlacker 10-12-2017 08:12 PM

What over 300 views and no one knows anything about this? :(

Richard Cranium 10-12-2017 08:39 PM

I know that I don't. I've never used any of Openbox, openresolv, or OpenVPN.

I know a little bit about dhcpcd, but I have absolutely no idea how you are using it in your environment.

If you give a little more detail, someone may be able to help.

LQSlacker 10-12-2017 08:53 PM

Quote:

Originally Posted by Richard Cranium (Post 5769336)
I know that I don't. I've never used any of Openbox, openresolv, or OpenVPN.

I know a little bit about dhcpcd, but I have absolutely no idea how you are using it in your environment.

If you give a little more detail, someone may be able to help.

Actually I did explain it, I use resovlconf with update-resolv-conf for OpenVPN, not sure what else to explain.

Maybe once openresolv/resovlconf is installed the only way to control this is with resovlconf.

For now in the resolvconf.conf I added in;

name_servers=

Which is keeping my nameserver, when I'm not using the VPN nameserver.

I just thought instead of this method, that when I'm disconnected from the VPN dhcpcd can be made to udpate resolv.conf, which it does do on its own...

It just seems that once you've installed resolvconf, then this is used and dhcpcd is by passed;

/lib/dhcpcd/dhcpcd-hooks/20-resolv.conf

Richard Cranium 10-12-2017 09:01 PM

If you have never used any of that, the statement...

Quote:

I use resovlconf with update-resolv-conf for OpenVPN
...is pretty meaningless. The words I've put in bold could be replaced by the word "barf" and the statement would have as much meaning to me.

I'm willing to help but I'm not willing to dig into the details of OpenVPN to do so. Dunno about the other couple of hundred people.

LQSlacker 10-12-2017 09:11 PM

This is the SBo for openresolv; (management framework for resolv.conf)

http://slackbuilds.org/repository/14...rch=openresolv

When using the update-resolv-conf for OpenVPN it pushes the DNS from the VPN server to the client, so that you are only using the DNS over the VPN tunnel...

When you make a connection to the OpenVPN server, resolvconf updates resolv.conf with the DNS from the VPN server, when you disconnect from the VPN, resolv.conf will now be empty. I thought dhcpcd would then update resolv.conf but it appears from this /path /lib/dhcpcd/dhcpcd-hooks/20-resolv.conf the hook for dhcpcd is now to do all this through resolvconf.

So for now, maybe I have accomplished this by placing in resolvconf.conf;

name_servers=

Because now that nameserver stays listed in resolv.conf, along with the new updated one from the VPN, and when I disconnect from the VPN my nameserver still stays in resolv.conf

I just had to make sure that now with both my ISP nameserver and the VPN nameserver, I wasn't getting them both queried online, because the point here is to only use the VPN nameserver, and when I tested this online, I was getting that result.

So now I have either figured out the correct way of doing this with resolvconf, or placed a band-aid on it, this I am trying to still figure out, the correct approach to this.

Hope I've made this clear now... :)

LQSlacker 10-13-2017 12:47 AM

I uninstalled openresolv then made sure any leftovers were removed, cleaned it all out and reinstalled it and it's working...

Not sure why it wasn't working before, but now when I disconnect from the VPN, dhcpcd restores resolv.conf back to it's original... :)


All times are GMT -5. The time now is 11:03 PM.