dhcpcd-discuss

dhcpcd does not remove DNS information with -x

Drew Morgan

Fri Jul 03 16:50:27 2015

Hi!

I'm experiencing some unexpected behavior with dhcpcd. In particular,
DNS information doesn't seem to be properly cleared when an interface
is de-configured. As an example, consider the following two sequences:

(assume wlan0 is up and associated with an access point)

# resolvconf -l
    (empty)
# dhcpcd wlan0
... (lease acquired)
# resolvconf -l
    (shows dns information for wlan0.dhcp)
# dhcpcd -k wlan0
... (lease released, dhcpcd shut down)
# resolvconf -l
    (empty)

contrasted with the following, where dhcpcd -k is replaced with dhcpcd -x:

# resolvconf -l
    (empty)
# dhcpcd wlan0
...  (lease acquired)
# resolvconf -l
    (shows dns information for wlan0.dhcp)
# dhcpcd -x wlan0
... (dhcpcd shut down)
# resolvconf -l
    (shows dns information for wlan0.dhcp)

In other words, something about the -x shutdown procedures seems to be
skipping the `resolvconf -d wlan0.dhcp' command from the
20-resolv.conf hook.

This is definitely unexpected behavior to me, since I expect
de-configuring an interface to include removing DNS information from
resolv.conf. This difference can even cause real problems, eg when the
wlan0 DNS servers aren't publicly addressable, but resolvconf ends up
giving them higher priority over DNS information from a different
interface anyway.

Is this a bug in dhcpcd, or am I misunderstanding what the -x command
should be doing?

Thank you!

Drew Morgan

Follow-Ups:
Re: dhcpcd does not remove DNS information with -xRoy Marples
Archive administrator: postmaster@marples.name