Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#45526 - [netctl] netctl does not allow dhcpcd to remove resolvconf entries

Attached to Project: Arch Linux
Opened by Andrew Morgan (slipperyfrob) - Thursday, 02 July 2015, 17:14 GMT
Last edited by Jouke Witteveen (jouke) - Friday, 03 July 2015, 19:40 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Jouke Witteveen (jouke)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

When using `netctl stop ${profile}', if the profile uses dhcpcd to configure DNS information through resolvconf, then the resolvconf entries are not cleared. Usually dhcpcd figures this out when the same interface is restarted with a new profile. However, it can cause issues when a new profile is started on a *different* interface, and the DNS information from the first interface is no longer valid. I put an example use-case at the bottom, in the "Steps to reproduce" section.


Additional info:

* package version(s)
I updated everything a couple days ago. In particular my netctl copy is up to date with the official repositories.

* config and/or log files etc.
See attached file, "dhcpcd-session.txt" for an example of how stopping dhcpcd in different ways can lead to different behaviors with resolvconf.


Steps to reproduce:

Suppose your laptop has two interfaces, wlan0 and eth0.

At home, you use a local DNS server at 192.168.1.1, which is the default DNS server for anyone connecting and using DHCP. You use the eth0 interface while at home, with DHCP, so this is the default DNS server.

Later, you disable the eth0 interface, suspend/hibernate your laptop, and go to work/school. You connect to the local wifi using wlan0. This gives you new DNS addresses, say Google's 8.8.8.8. However, when you try to connect to the Internet, DNS resolution becomes very slow.

The reason is that the old eth0 information is still present, and has been given a higher priority (for whatever reason), so your machine always tries to check with 192.168.1.1 for DNS resolution, waiting for a timeout, and then continuing with 8.8.8.8.


Work-arounds:

This can be fixed by running `resolvconf -d ${interface}' to remove the old DNS information. I doubt this runs the other dhcpcd hooks though, which might be causing other problems on the system.
This task depends upon

Closed by  Jouke Witteveen (jouke)
Friday, 03 July 2015, 19:40 GMT
Reason for closing:  Not a bug
Comment by Jouke Witteveen (jouke) - Friday, 03 July 2015, 08:54 GMT
The '-k' parameter to kill dhcpcd is used when 'DHCPReleaseOnStop' is set to 'yes'. Otherwise, the '-x' parameter is used. If you think the '-x' parameter should clear the resolvconf entries too, you should take it up with the dhcpcd developer. Whenever custom DNS entries are specified in a profile, 'resolvconf -d ${interface}' is executed when stopping a profile. In other words, I believe the behavior you desire is already implemented...
Comment by Andrew Morgan (slipperyfrob) - Friday, 03 July 2015, 16:24 GMT
Thank you! Considering the man page for dhcpcd says that both -x and -k "deconfigure the interface", it seems reasonable for that to include properly updating DNS information. I should have tried -x as well. I'll go bug the dhcpcd people.

I just have one lingering question: why is the default to use -x instead of -k? What's the downside to not releasing the lease?
Comment by Jouke Witteveen (jouke) - Friday, 03 July 2015, 19:39 GMT
Defaulting to '-x' (i.e. not releasing the lease) was requested in  FS#35760 .

Loading...