[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to make dhclient reread its config? (Debian 10)



On Wed, Aug 26, 2020 at 10:56:30AM +0700, Victor Sudakov wrote:
> I've made some changes to /etc/dhcp/dhclient.conf, now I need to make
> dhclient reread it (and apply the changes to /etc/resolv.conf).

There is nothing you can put in dhclient.conf that will successfully
prevent dhclient from fucking up your resolv.conf file in the general
case.  (You might be lucky enough that it works on *one* network, but
even then, why take the chance?)

Please see <https://wiki.debian.org/resolv.conf> for your options.

As far as "re-reading" goes, what you want to do is bring the interface
down and back up.

ifdown yourifname
ifup yourifname

Obviously you can't do that in two steps if the machine is remote.  If
it's a remote machine, you'll need to do something clever-ish, like

ifdown yourifname; sleep 2; ifup yourifname

And *do not* make any mistakes.  (Doing it inside screen or tmux would
also be wise, just in case you lose the ssh connection during those
few seconds.)

Another alternative would be simply to reboot.


Reply to: