When I make changes to dhclient.conf such as modifying the DNS search path (so that the changes don't get lost on reboot or DHCP renews), how do I regenerate /etc/resolv.conf? That page suggests dhclient -r; dhclient which releases the address, thus disrupting my connection and preventing me from reaching the host again. Is there another way of doing this? Thanks.
Asked
Active
Viewed 7,382 times
4
xyzzyrz
- 896
1 Answers
-1
Just use your favorite editor to edit /etc/resolv.conf (or /run/resolvconf/resolv.conf if you are running Ubuntu 12.04 or later with resolvconf active).
After a reboot or an interface downup cycle, resolv.conf should be correctly regenerated so that you can reconnect. If that isn't the case then you have another problem.
jdthood
- 12,625
-
That's actually the type of hack I do today in a one-off fashion (so far can handle
supersede domain-nameonly), but since this is part of a general-purpose configuration management system, I was hoping for a more systematic way rather than writing/reproducing code to understand the various types of clauses indhclient.confand applying them to resolv.conf. – xyzzyrz Apr 20 '13 at 08:28
resolvconf -ubut it doesn't incorporate the changes made todhclient.conf. – xyzzyrz Apr 19 '13 at 22:14supersede domain-name "...";directive in the page I linked to, as an example. If I add them to/etc/resolvconf/resolv.conf.d/basewon't they just get overwritten on e.g. next reboot/renew? – xyzzyrz Apr 20 '13 at 00:50