dhcpcd-discuss

Re: dhcpcd does not remove DNS information with -x

Roy Marples

Fri Jul 03 19:06:43 2015

Hi Drew

On Friday 03 July 2015 11:50:27 Drew Morgan wrote:
> 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?

You are misunderstanding the command line
-x simply means exit - everything configured is still configured
-k means de-configure the interface (also releases the lease back to the server 
for another user)

Roy

Follow-Ups:
Re: dhcpcd does not remove DNS information with -xDrew Morgan
References:
dhcpcd does not remove DNS information with -xDrew Morgan
Archive administrator: postmaster@marples.name