dhcpcd-discuss

dhcpcd --exit does not clean up resolv.conf

Henning Schild

Fri Aug 04 08:49:24 2017

Hey,

i am using dhcpcd and am very happy with how it manages resolv.conf
from various interfaces. But that magic quickly becomes a problem if
something like a vpn client wants to manage that file. The copy of the
client will get overwritten by dhcpcd all the time.

My solution to that is to start a dhcpcd with static ip_address routers
domain_name_servers domain_name ... instead of letting the vpn client
generate a resolv.conf. That works like a charm with i.e. the wifi
dhcpcd that is running next to the tun one. Local names still resolve,
after a while ... ;).

When the vpn clients shuts down i "dhcpcd -x tun" but that does not
clear the injected values from resolv.conf, where i think it probably
should. At least the nameservers seem to move down in the list.
I am talking about v6.11.3 in case the problem is known and fixed.

Another issue i found is that "dhcpcd tun0" requires a "dhcpcd -x
tun0-4" to match the PIDfile. I guess the number 4 is somehow generated
when creating the file so the killing process should do the same steps
to find that file.

I think that is a good way of dealing with resolv.conf issues, or does
anyone have a better suggestion?

regards,
Henning

Follow-Ups:
Re: dhcpcd --exit does not clean up resolv.confRoy Marples
Archive administrator: postmaster@marples.name