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

Re: How stable is the frozen stretch?



On Tue, May 16, 2017 at 06:26:51PM -0400, Fungi4All wrote:
> But in recent times have brought me various frustrations with deb...
> particularly with resolv.conf acting as it has a mind of its own and
> vanishing my set of dns collections and replacing them with its believed to
> be best for me.

If you run as a DHCP client, the dhclient program requests DNS nameservers
and hostname and domain from the DHCP server by default, periodically.
It will overwrite /etc/resolv.conf if configured to do so.  It is
configured to do so by default.  So, you will change this.

Step 1: Remove the resolvconf package, if it is installed.

Step 2: Edit /etc/dhcp/dhclient.conf and either make it stop requesting
nameserver info altogether by removing these lines:

titan:/etc/dhcp$ diff -u dhclient.conf.20170510 dhclient.conf
--- dhclient.conf.20170510      2017-05-10 18:49:25.838259274 -0400
+++ dhclient.conf       2017-05-10 18:49:58.426123217 -0400
@@ -20,8 +20,6 @@
 #supersede domain-name "fugue.com home.vix.com";
 #prepend domain-name-servers 127.0.0.1;
 request subnet-mask, broadcast-address, time-offset, routers,
-       domain-name, domain-name-servers, domain-search, host-name,
-       dhcp6.name-servers, dhcp6.domain-search,
        netbios-name-servers, netbios-scope, interface-mtu,
        rfc3442-classless-static-routes, ntp-servers;
 #require subnet-mask, domain-name-servers;

Or, if you prefer, you can uncomment and edit the lines that say
"supersede domain-name" and "prepend domain-name-servers".  If you do
it that way, dhclient will still request the information, and it will
still overwrite /etc/resolv.conf periodically, but it will do so with
your edits in mind.  And you'll have to remember that directly editing
/etc/resolv.conf will not work.

I'll assume you chose to delete the lines indicated in the diff, because
this is much simpler.

Step 3: Bring your network interface down and back up, to restart the
dhclient program.  Otherwise, the already-running dhclient will
continue requesting nameserver info from your DHCP server, undoing
your edits continually.  You can either reboot, or run "ifdown eth0"
and "ifup eth0", assuming your network interface is eth0.

Step 4: Edit /etc/resolv.conf as you see fit.


Reply to: