Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #268037

Re: resolv.conf (was Re: electrons/the Internet [racism redacted])

From David Christensen <dpchrist@holgerdanske.com>
Newsgroups linux.debian.user
Subject Re: resolv.conf (was Re: electrons/the Internet [racism redacted])
Date 2024-03-05 00:50 +0100
Message-ID <Ieqee-esBj-3@gated-at.bofh.it> (permalink)
References <Iejw5-eoxO-5@gated-at.bofh.it> <Iengm-eqNC-13@gated-at.bofh.it> <IenT3-erg1-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 3/4/24 13:11, Greg Wooledge wrote:
> On Mon, Mar 04, 2024 at 12:36:54PM -0800, David Christensen wrote:
>> I believe Debian rewrites /etc/resolv.conf on every boot.
> 
> This is not correct.  It's *partly* correct if you ignore a lot of
> complicating factors.
> 
> Short version: read <https://wiki.debian.org/resolv.conf>.
> 
> Long version follows:
> 
> If you have a static network interface configuration, defined in
> /etc/network/interfaces, with no DHCP client, no VPN stuff going on,
> etc. then your /etc/resolv.conf will not be changed.  You can edit the
> file and put whatever you want in it, and it'll remain as you wish it
> to be.
> 
> Unfortunately, almost *nobody* has a setup like this any more.
> 
> In a more typical environment, you get your IP address via DHCP, which
> means you're running a DHCP client daemon.  Most DHCP client daemons
> will rewrite the /etc/resolv.conf file every time they refresh their
> DHCP lease.  This may indeed happen at boot time, but it'll also happen
> a couple times a day during normal operations.
> 
> So, a simple instruction like "edit /etc/resolv.conf" is no longer
> possible.  Even worse, there's no single *alternative* either.  You can't
> even say "do ___ instead".
> 
> To put the correct values into your /etc/resolv.conf file nowdays, you
> have to select a *strategy*.  You need to find an indirect way to put
> the right content into some *other* place, in such a way that it will
> eventually find its way into /etc/resolv.conf every time the file is
> rewritten.  And there are *lots* of strategies that will work, so you
> can't even say "obviously this one is best".  Life is not that simple.
> 
> Or, you could use chattr +i to make the /etc/resolv.conf file immutable,
> so DHCP clients and other programs cannot overwrite it.
> 
> Either way, you take ownership of whatever strategy you decide to use,
> together with its pros and cons.  You'll have to understand that on *this*
> system, you went with *this* strategy, and remember where to put your
> changes, and how to make them.  Or at the very least, you'll need to be
> *aware* of all the strategies you've got in play on all of your systems,
> and know how to identify which one is in use on any given system.


Thank you for the clarification.  Thankfully, my gateway DHCP server and 
my Debian instances work together.


David

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

electrons/the Internet doesn't like question authority niggahs?, or  is it that I like to eat raw garlic, ... Albretch Mueller <lbrtchx@gmail.com> - 2024-03-04 17:40 +0100
  Re: electrons/the Internet doesn't like question authority niggahs?,  or is it that I like to eat raw garlic, ... Andy Smith <andy@strugglers.net> - 2024-03-04 18:00 +0100
    Re: electrons/the Internet doesn't like question authority niggahs?,  or is it that I like to eat raw garlic, ... Albretch Mueller <lbrtchx@gmail.com> - 2024-03-05 01:40 +0100
  Re: electrons/the Internet [...] <tomas@tuxteam.de> - 2024-03-04 18:00 +0100
  Re: electrons/the Internet doesn't like question authority niggahs?,  or is it that I like to eat raw garlic, ... David Christensen <dpchrist@holgerdanske.com> - 2024-03-04 21:40 +0100
    resolv.conf (was Re: electrons/the Internet [racism redacted]) Greg Wooledge <greg@wooledge.org> - 2024-03-04 22:20 +0100
      Re: resolv.conf (was Re: electrons/the Internet [racism redacted]) Jeffrey Walton <noloader@gmail.com> - 2024-03-04 22:30 +0100
      Re: resolv.conf (was Re: electrons/the Internet [racism redacted]) Markus Schönhaber <debian-user@list-post.mks-mail.de> - 2024-03-04 23:30 +0100
      Re: resolv.conf (was Re: electrons/the Internet [racism redacted]) David Christensen <dpchrist@holgerdanske.com> - 2024-03-05 00:50 +0100
    Re: electrons/the Internet doesn't like … that I like to eat raw garlic, ... David Wright <deblis@lionunicorn.co.uk> - 2024-03-05 01:10 +0100
      Re: electrons/the Internet doesn't like … that I like to eat raw garlic, ... David Christensen <dpchrist@holgerdanske.com> - 2024-03-05 04:10 +0100
  Re: electrons/the Internet doesn't like question authority niggahs?,  oris it that I like to eat raw garlic, ... gene heskett <gheskett@shentel.net> - 2024-03-05 01:50 +0100
    Re: electrons/the Internet doesn't like question authority niggahs?,  oris it that I like to eat raw garlic, ... <tomas@tuxteam.de> - 2024-03-05 06:40 +0100
      Re: electrons/the Internet doesn't like question authority  niggahs?,oris it that I like to eat raw garlic, ... gene heskett <gheskett@shentel.net> - 2024-03-05 09:20 +0100

csiph-web