wicd doesn't update resolv.conf #88

Closed
fare opened this Issue Feb 13, 2013 · 9 comments

Projects

None yet

5 participants

fare commented Feb 13, 2013

wicd and/or the dhcpcd it spawns won't properly update /etc/resolv.conf.

Also, networkmanager looks like it's doing it, but without going through resolvconf, which seems to be a mistake.

Member
viric commented Feb 13, 2013

On Wed, Feb 13, 2013 at 07:08:57AM -0800, François-René Rideau wrote:

wicd and/or the dhcpcd it spawns won't properly update /etc/resolv.conf.

Also, networkmanager looks like it's doing it, but without going through resolvconf, which seems to be a mistake.

I think it's meant to do something with openresolv. But I still don't know how
it works. I dno't use those tools.

Member

If I understand correctly wicd does set /etc/resolv.conf correctly according to your preferences, but then dhcpcd will clobber it. One way to workaround this is to use chattr to make it immutable: chattr +i /etc/resolv.conf. A nicer way would be to configure dhcpcd so that it doesn't do this: nohook resolv.conf (according to https://wiki.archlinux.org/index.php/Resolv.conf). There isn't an option for this in the dhcpcd nixos module, so I'll see if I can add one and test this out. I guess setting networking.useDHCP will also prevent this from happening, but people may want to use dhcp to get an IP address but override the DNS servers with their own preferred servers so I think adding an extra option here would make sense.

@cillianderoiste cillianderoiste added a commit that referenced this issue Feb 17, 2013
@cillianderoiste cillianderoiste #88 dhcpcd: Add option to prevent dhcpcd from clobbering /etc/resolv.…
…conf

Without this option enabled dhcpcd will insist on overwriting
/etc/resolv.conf even if has been modified manually, or by using a
program such as wicd.
dd3bca5
fare commented Feb 18, 2013

Uh, don't we want dhcpcd to use resolvconf like everyone?
Also, how else than with dhcpcd am I going to get the nameserver for my particular network???
I want my resolv.conf to reflect what dhcpcd says -- and if I have static nameservers, NixOS seems to already add them to /run/resolvconf/interfaces/static which seems to me to be the Right Thing(tm).
Or maybe I'm confused as to the particular set of options to use.

fare commented Feb 18, 2013

Also I probably want 8.8.8.8 and 8.8.4.4 not as static nameservers but as "fallback" nameservers in case no good one is found (for some value of "good" that could be configured).

Member

I think I see what's happening: lib/python2.7/site-packages/wicd/misc.py find_path is used to find the full path to resolvconf, it only looks in standard system paths, so that should be fixed.

fare commented Feb 18, 2013

Note that the problem is not ONLY with wicd. It looks like dhcpcd and network-manager are also misbehaving, though in ways that kind of make do by default.

Owner

Dhcpcd uses resolvconf, so it does the right thing as far as I can tell. Example:

$ cat /run/resolvconf/interfaces/wlan0 
# Generated by dhcpcd from wlan0
domain fritz.box
nameserver 192.168.178.1

However, that's NixOS' dhcpcd service, not one spawned by wicd.

Member

I guess that adding openresolv to the inputs and ensuring that it is in the PATH will help for wicd. (I can try that later on).

@cillianderoiste cillianderoiste added a commit to NixOS/nixpkgs that referenced this issue Feb 18, 2013
@cillianderoiste cillianderoiste wicd: NixOS/nixos#88 add resolvconf to PATH for wicd
with this patch resolvconf is used to set the DNS via wicd, although
this doesn't seem to stop dhcpcd from clobbering /etc/resolv.conf
f81dbf4
Member

I've added the path to resolvconf to wicd, now the /etc/resolv.conf it creates looks like this. /etc/resolv.conf does now claim to be generated by resolvconf, but that doesn't stop dhcpcd from clobbering it shortly afterwards. Restarting dhcpcd will trigger this immediately.

@domenkozar domenkozar closed this May 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment