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


Groups > linux.debian.user > #231989 > unrolled thread

Got a machine name problem

Started byGene Heskett <gheskett@shentel.net>
First post2021-02-23 19:00 +0100
Last post2021-02-24 12:30 +0100
Articles 20 on this page of 31 — 14 participants

Back to article view | Back to linux.debian.user


Contents

  Got a machine name problem Gene Heskett <gheskett@shentel.net> - 2021-02-23 19:00 +0100
    Re: Got a machine name problem Dan Ritter <dsr@randomstring.org> - 2021-02-23 19:10 +0100
    Re: Got a machine name problem Tom Browder <tom.browder@gmail.com> - 2021-02-23 20:30 +0100
      Re: Got a machine name problem "James B" <portoteacher80@fastmail.com> - 2021-02-24 01:30 +0100
        Re: Got a machine name problem "James B" <portoteacher80@fastmail.com> - 2021-02-24 01:30 +0100
        Re: Got a machine name problem Gene Heskett <gheskett@shentel.net> - 2021-02-24 02:30 +0100
          Re: Got a machine name problem <tomas@tuxteam.de> - 2021-02-24 09:40 +0100
            Re: Got a machine name problem <tomas@tuxteam.de> - 2021-02-24 12:20 +0100
              Re: Got a machine name problem Stefan Monnier <monnier@iro.umontreal.ca> - 2021-02-24 16:20 +0100
            Re: Got a machine name problem Gene Heskett <gheskett@shentel.net> - 2021-02-24 12:20 +0100
              Re: Got a machine name problem Greg Wooledge <greg@wooledge.org> - 2021-02-24 14:50 +0100
                Re: Got a machine name problem Tom Browder <tom.browder@gmail.com> - 2021-02-24 15:00 +0100
                  Re: Got a machine name problem Greg Wooledge <greg@wooledge.org> - 2021-02-24 15:20 +0100
                    Re: Got a machine name problem Tom Browder <tom.browder@gmail.com> - 2021-02-24 15:30 +0100
                Re: Got a machine name problem Gene Heskett <gheskett@shentel.net> - 2021-02-24 18:30 +0100
                  Re: Got a machine name problem Greg Wooledge <greg@wooledge.org> - 2021-02-24 19:00 +0100
                    Re: Got a machine name problem IL Ka <kazakevichilya@gmail.com> - 2021-02-24 19:20 +0100
                  Re: Got a machine name problem Celejar <celejar@gmail.com> - 2021-02-24 19:00 +0100
      Re: Got a machine name problem Gene Heskett <gheskett@shentel.net> - 2021-02-24 02:10 +0100
        Re: Got a machine name problem David Wright <deblis@lionunicorn.co.uk> - 2021-02-24 02:40 +0100
          Re: Got a machine name problem Tom Browder <tom.browder@gmail.com> - 2021-02-24 03:30 +0100
          Re: Got a machine name problem Gene Heskett <gheskett@shentel.net> - 2021-02-24 04:30 +0100
        Re: Got a machine name problem Stefan Monnier <monnier@iro.umontreal.ca> - 2021-02-24 06:00 +0100
          Re: Got a machine name problem Gene Heskett <gheskett@shentel.net> - 2021-02-24 06:10 +0100
            OT: Spicy stuff in sensitive areas (was Re: Got a machine name problem) The Wanderer <wanderer@fastmail.fm> - 2021-02-24 12:20 +0100
        Re: Got a machine name problem Brian <ad44@cityscape.co.uk> - 2021-02-24 15:20 +0100
          Re: Got a machine name problem Brian <ad44@cityscape.co.uk> - 2021-02-24 21:20 +0100
    Re: Got a machine name problem David Christensen <dpchrist@holgerdanske.com> - 2021-02-24 03:00 +0100
      Re: Got a machine name problem David Wright <deblis@lionunicorn.co.uk> - 2021-02-24 06:00 +0100
    Re: Got a machine name problem "Andrew M.A. Cater" <amacater@einval.com> - 2021-02-24 12:20 +0100
      Re: Got a machine name problem Gene Heskett <gheskett@shentel.net> - 2021-02-24 12:30 +0100

Page 1 of 2  [1] 2  Next page →


#231989 — Got a machine name problem

FromGene Heskett <gheskett@shentel.net>
Date2021-02-23 19:00 +0100
SubjectGot a machine name problem
Message-ID<BLK8x-3Vl-3@gated-at.bofh.it>
Greetings all;

I have been working on a lower priority project, replacing some atom 
powered machines with i5 powered Dells. Installing buster but something 
is overriding my efforts to rename the machine after the install because 
I'd like to replace "lathe" with "TLM" for The Little Monster.

Nothing I do survives a reboot, so what do I do to actually rename the 
machine and make it stick? Hopefully without losiing the networking 
which I don't have after the last reboot, probably because of the 
current volatility of interface names.

Thanks.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>

[toc] | [next] | [standalone]


#231990

FromDan Ritter <dsr@randomstring.org>
Date2021-02-23 19:10 +0100
Message-ID<BLKid-4ev-1@gated-at.bofh.it>
In reply to#231989
Gene Heskett wrote: 
> Greetings all;
> 
> I have been working on a lower priority project, replacing some atom 
> powered machines with i5 powered Dells. Installing buster but something 
> is overriding my efforts to rename the machine after the install because 
> I'd like to replace "lathe" with "TLM" for The Little Monster.
> 
> Nothing I do survives a reboot, so what do I do to actually rename the 
> machine and make it stick? Hopefully without losiing the networking 
> which I don't have after the last reboot, probably because of the 
> current volatility of interface names.

Typically, edit /etc/hostname and reboot, or run 
hostname -F /etc/hostname
for immediate effect.

Check to see if you have assigned a name via dhcp or in
/etc/hosts.

-dsr-

[toc] | [prev] | [next] | [standalone]


#231991

FromTom Browder <tom.browder@gmail.com>
Date2021-02-23 20:30 +0100
Message-ID<BLLxD-4YR-3@gated-at.bofh.it>
In reply to#231989
On Tue, Feb 23, 2021 at 11:59 AM Gene Heskett <gheskett@shentel.net> wrote:
...
> Nothing I do survives a reboot, so what do I do to actually rename the
> machine and make it stick? Hopefully without losiing the networking

Hey, Gene.  I usually have to fiddle around a little, but I've always
had success on Debian this way (as root):

    # hostname TLM

   edit /etc/hostname and set the desired name to TLM if it's not
already changed

I also edit /etc/hosts and make the first couple of lines look like this:

    127.0.0.1 localhost.localdomain.com   localhost
    127.0.1.1 TLM.geneslinuxbox.net        TLM

Then reboot and cross your fingers.

Blessings,

-Tom

P.S. Keep your powder dry!

[toc] | [prev] | [next] | [standalone]


#231998

From"James B" <portoteacher80@fastmail.com>
Date2021-02-24 01:30 +0100
Message-ID<BLQdX-7Np-3@gated-at.bofh.it>
In reply to#231991
With systemd-based Debian, the probably now best way to set a hostname is with:

hostnamectl set-hostname NAME

What Tom suggested is completely valid, but hostnamectl should I understand be the preferred route as I believe it will update everything necessary automatically.Doing it this way will also be a persistent change.

James
-- 
  James B
  portoteacher80@fastmail.com

Em Ter, 23 Fev ʼ21, às 19:29, Tom Browder escreveu:
> On Tue, Feb 23, 2021 at 11:59 AM Gene Heskett <gheskett@shentel.net> wrote:
> ...
> > Nothing I do survives a reboot, so what do I do to actually rename the
> > machine and make it stick? Hopefully without losiing the networking
> 
> Hey, Gene.  I usually have to fiddle around a little, but I've always
> had success on Debian this way (as root):
> 
>     # hostname TLM
> 
>    edit /etc/hostname and set the desired name to TLM if it's not
> already changed
> 
> I also edit /etc/hosts and make the first couple of lines look like this:
> 
>     127.0.0.1 localhost.localdomain.com   localhost
>     127.0.1.1 TLM.geneslinuxbox.net        TLM
> 
> Then reboot and cross your fingers.
> 
> Blessings,
> 
> -Tom
> 
> P.S. Keep your powder dry!
> 
>

[toc] | [prev] | [next] | [standalone]


#231999

From"James B" <portoteacher80@fastmail.com>
Date2021-02-24 01:30 +0100
Message-ID<BLQdX-7Np-5@gated-at.bofh.it>
In reply to#231998
To my mind, getting familiar with the newer 'ctl' commands that come with systemd is no bad idea.I like the consistency, personally.The 'systemctl' command is one to be used all the time particularly.

-- 
  James B
  portoteacher80@fastmail.com

Em Qua, 24 Fev ʼ21, às 00:22, James B escreveu:
> With systemd-based Debian, the probably now best way to set a hostname is with:
> 
> hostnamectl set-hostname NAME
> 
> What Tom suggested is completely valid, but hostnamectl should I 
> understand be the preferred route as I believe it will update 
> everything necessary automatically.Doing it this way will also be a 
> persistent change.
> 
> James
> -- 
>   James B
>   portoteacher80@fastmail.com
> 
> Em Ter, 23 Fev ʼ21, às 19:29, Tom Browder escreveu:
> > On Tue, Feb 23, 2021 at 11:59 AM Gene Heskett <gheskett@shentel.net> wrote:
> > ...
> > > Nothing I do survives a reboot, so what do I do to actually rename the
> > > machine and make it stick? Hopefully without losiing the networking
> > 
> > Hey, Gene.  I usually have to fiddle around a little, but I've always
> > had success on Debian this way (as root):
> > 
> >     # hostname TLM
> > 
> >    edit /etc/hostname and set the desired name to TLM if it's not
> > already changed
> > 
> > I also edit /etc/hosts and make the first couple of lines look like this:
> > 
> >     127.0.0.1 localhost.localdomain.com   localhost
> >     127.0.1.1 TLM.geneslinuxbox.net        TLM
> > 
> > Then reboot and cross your fingers.
> > 
> > Blessings,
> > 
> > -Tom
> > 
> > P.S. Keep your powder dry!
> > 
> >
> 
>

[toc] | [prev] | [next] | [standalone]


#232002

FromGene Heskett <gheskett@shentel.net>
Date2021-02-24 02:30 +0100
Message-ID<BLRa1-8lO-1@gated-at.bofh.it>
In reply to#231998
On Tuesday 23 February 2021 19:22:19 James B wrote:

> With systemd-based Debian, the probably now best way to set a hostname
> is with:
>
> hostnamectl set-hostname NAME
>
> What Tom suggested is completely valid, but hostnamectl should I
> understand be the preferred route as I believe it will update
> everything necessary automatically.Doing it this way will also be a
> persistent change.
>
> James

Does this also have a set-domainname option? This also is disappearing on 
a reboot. Not ack the man page so I assume there is a different method 
to handle that?

Thanks James.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>

[toc] | [prev] | [next] | [standalone]


#232011

From<tomas@tuxteam.de>
Date2021-02-24 09:40 +0100
Message-ID<BLXS9-3Yj-1@gated-at.bofh.it>
In reply to#232002

[Multipart message — attachments visible in raw view] — view raw

On Tue, Feb 23, 2021 at 08:21:48PM -0500, Gene Heskett wrote:
> On Tuesday 23 February 2021 19:22:19 James B wrote:
> 
> > With systemd-based Debian, the probably now best way to set a hostname
> > is with:
> >
> > hostnamectl set-hostname NAME
> >
> > What Tom suggested is completely valid, but hostnamectl should I
> > understand be the preferred route [...]

...if you restrict yourself to the systemd world [0], that is.

> Does this also have a set-domainname option? This also is disappearing on 
> a reboot. Not ack the man page so I assume there is a different method 
> to handle that?

Gene, please read the hostname(1) man page. It is short and sweet
(120 - 240 lines, depending on your screen width). It's all in there.

Choice quotes:

- from the top
  NAME
       hostname - show or set the system's host name
       domainname - show or set the system's NIS/YP domain name
       ypdomainname - show or set the system's NIS/YP domain name
       nisdomainname - show or set the system's NIS/YP domain name
       dnsdomainname - show the system's DNS domain name

you can safely ignore all that NIS/YP [1] part, that rules out the
variants 2-4; the last variant only shows the DNS domain name --
you'd have to talk to Someone Else (TM) to change that. This leaves
variant (1), i.e. hostname.

Now:

  DESCRIPTION
    [...]
    SET NAME
      When called with one argument or with the --file option, the
      commands set the host name or the NIS/YP domain name [...]

So... it seems we're out of luck? Only changing your domain if it is
with NIS/YP is supported? But, oh, lookee...

   THE FQDN
     The FQDN (Fully Qualified Domain Name) of the system is the
     name that the resolver(3) returns for the host name, such as,
     ursula.example.com [...]

     You cannot change the FQDN with hostname or dnsdomainname.

     The recommended method of setting the FQDN is to make the
     hostname be an alias for the fully qualified name using
     /etc/hosts, DNS, or NIS [...]

So if your domain isn't imposed on your host by DNS (you would
know that, since that's your home network, and you'd have done
some setup to enforce that or by NIS/YP (you most probably don't
have that, your network admin, i.e. you, would know that), the
result is... go look in your /etc/hosts [2] for the domain name
your box thinks it has.

This seemingly baroque thing is due that the domain name "in"
which your box lives is a decision that not always can be
taken by your box alone. Like when I'm in France, I can't say
"I'm in Luxembourg" unless I am a rich person ;-)

(Exchange perhaps France for U.S. and Luxembourg for Delaware
for those west of the pond. For those elsewhere, please teach
me: where are your favourite tax paradises?)

Cheers

[0] Me? I prefer to stay portable. Works consistently across
   systemd and non-systemd boxes.
[1] https://en.wikipedia.org/wiki/Network_Information_Service
[2] which kinda makes sense: if you squint a bit, /etc/hosts
   is sorta the "poor person's DNS". Read on the resolver, and
   /etc/resolv.conf for the next rabbit hole.

 - t

[toc] | [prev] | [next] | [standalone]


#232016

From<tomas@tuxteam.de>
Date2021-02-24 12:20 +0100
Message-ID<BM0mZ-5BF-3@gated-at.bofh.it>
In reply to#232011

[Multipart message — attachments visible in raw view] — view raw

On Wed, Feb 24, 2021 at 06:14:00AM -0500, Gene Heskett wrote:
> On Wednesday 24 February 2021 03:32:04 tomas@tuxteam.de wrote:
> 
> > On Tue, Feb 23, 2021 at 08:21:48PM -0500, Gene Heskett wrote:
> > > On Tuesday 23 February 2021 19:22:19 James B wrote:
> > > > With systemd-based Debian, the probably now best way to set a
> > > > hostname is with:
> > > >
> > > > hostnamectl set-hostname NAME
> > > >
> > > > What Tom suggested is completely valid, but hostnamectl should I
> > > > understand be the preferred route [...]
> >
> > ...if you restrict yourself to the systemd world [0], that is.
> >
> > > Does this also have a set-domainname option? This also is
> > > disappearing on a reboot. Not ack the man page so I assume there is
> > > a different method to handle that?
> >
> > Gene, please read the hostname(1) man page.

[...]

> I could spend the rest of my life changing it with variant 1, but when 
> its been powered down overnight, the old name is restored in the morning 
> boot. Now I've tried hostnamectl with its option set-hostname newname.
> And I'm going to power it up right now, brb.

Uh... sorry, you're right. You've got to change /etc/hostname for that.
By whatever means explained in this thread.

Tomas, please read posts more carefully :-)

Apologies
 - t

[toc] | [prev] | [next] | [standalone]


#232032

FromStefan Monnier <monnier@iro.umontreal.ca>
Date2021-02-24 16:20 +0100
Message-ID<BM47f-7Qp-3@gated-at.bofh.it>
In reply to#232016
> Tomas, please read posts more carefully :-)

FWIW, `man hostname` also mentions /etc/hostname and /etc/hosts.


        Stefan

[toc] | [prev] | [next] | [standalone]


#232017

FromGene Heskett <gheskett@shentel.net>
Date2021-02-24 12:20 +0100
Message-ID<BM0mZ-5BF-5@gated-at.bofh.it>
In reply to#232011
On Wednesday 24 February 2021 03:32:04 tomas@tuxteam.de wrote:

> On Tue, Feb 23, 2021 at 08:21:48PM -0500, Gene Heskett wrote:
> > On Tuesday 23 February 2021 19:22:19 James B wrote:
> > > With systemd-based Debian, the probably now best way to set a
> > > hostname is with:
> > >
> > > hostnamectl set-hostname NAME
> > >
> > > What Tom suggested is completely valid, but hostnamectl should I
> > > understand be the preferred route [...]
>
> ...if you restrict yourself to the systemd world [0], that is.
>
> > Does this also have a set-domainname option? This also is
> > disappearing on a reboot. Not ack the man page so I assume there is
> > a different method to handle that?
>
> Gene, please read the hostname(1) man page. It is short and sweet
> (120 - 240 lines, depending on your screen width). It's all in there.
>
> Choice quotes:
>
> - from the top
>   NAME
>        hostname - show or set the system's host name
>        domainname - show or set the system's NIS/YP domain name
>        ypdomainname - show or set the system's NIS/YP domain name
>        nisdomainname - show or set the system's NIS/YP domain name
>        dnsdomainname - show the system's DNS domain name
>
I could spend the rest of my life changing it with variant 1, but when 
its been powered down overnight, the old name is restored in the morning 
boot. Now I've tried hostnamectl with its option set-hostname newname.
And I'm going to power it up right now, brb.

Ok hostname is good after reboot, but domainname has been reset to 
(none).

But wtf? I have edited "sudo nano" /etc/domainname, did not set the i 
bit, and the edit is still there, but asking for it is (none)

domainname domain.name changes it only for this boot, a reboot clears it 
to (none) again.

So I must have screwed something up with that edit, but how do I fix it?

Thanks Tomas.

> you can safely ignore all that NIS/YP [1] part, that rules out the
> variants 2-4; the last variant only shows the DNS domain name --
> you'd have to talk to Someone Else (TM) to change that. This leaves
> variant (1), i.e. hostname.
>
> Now:
>
>   DESCRIPTION
>     [...]
>     SET NAME
>       When called with one argument or with the --file option, the
>       commands set the host name or the NIS/YP domain name [...]
>
> So... it seems we're out of luck? Only changing your domain if it is
> with NIS/YP is supported? But, oh, lookee...
>
>    THE FQDN
>      The FQDN (Fully Qualified Domain Name) of the system is the
>      name that the resolver(3) returns for the host name, such as,
>      ursula.example.com [...]
>
>      You cannot change the FQDN with hostname or dnsdomainname.
>
>      The recommended method of setting the FQDN is to make the
>      hostname be an alias for the fully qualified name using
>      /etc/hosts, DNS, or NIS [...]
>
> So if your domain isn't imposed on your host by DNS (you would
> know that, since that's your home network, and you'd have done
> some setup to enforce that or by NIS/YP (you most probably don't
> have that, your network admin, i.e. you, would know that), the
> result is... go look in your /etc/hosts [2] for the domain name
> your box thinks it has.
>
> This seemingly baroque thing is due that the domain name "in"
> which your box lives is a decision that not always can be
> taken by your box alone. Like when I'm in France, I can't say
> "I'm in Luxembourg" unless I am a rich person ;-)
>
> (Exchange perhaps France for U.S. and Luxembourg for Delaware
> for those west of the pond. For those elsewhere, please teach
> me: where are your favourite tax paradises?)
>
> Cheers
>
> [0] Me? I prefer to stay portable. Works consistently across
>    systemd and non-systemd boxes.
> [1] https://en.wikipedia.org/wiki/Network_Information_Service
> [2] which kinda makes sense: if you squint a bit, /etc/hosts
>    is sorta the "poor person's DNS". Read on the resolver, and
>    /etc/resolv.conf for the next rabbit hole.

Rabbit hole is a misnomer, its worse than that. :(

Perhaps I should edit /etc/resolv.conf so it uses localhost, then the dns 
address, for resolving.  Its a real file here. And in looking around, 
none of my buster machines have a domainname. ???  That rabbit hole goes 
down to the iron core. At which point we have well overdone fried 
rabbit.

Thanks Tomas

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>

[toc] | [prev] | [next] | [standalone]


#232024

FromGreg Wooledge <greg@wooledge.org>
Date2021-02-24 14:50 +0100
Message-ID<BM2I9-6Tf-3@gated-at.bofh.it>
In reply to#232017
Gene Heskett (gheskett@shentel.net) wrote:
> But wtf? I have edited "sudo nano" /etc/domainname, did not set the i 
> bit, and the edit is still there, but asking for it is (none)

There is no such file on my system.  What made you think that you should
create this file?  What program did you think would use it?

> domainname domain.name changes it only for this boot, a reboot clears it 
> to (none) again.

       domainname - show or set the system's NIS/YP domain name

Are you using NIS?  If you are, you should be configuring the NIS domain
name in the file /etc/defaultdomain (which is read by /etc/init.d/nis
which is what the systemd unit points to, because apparently Debian's NIS
packaging is not fully updated for systemd).

But I think you're actually just confused, and you aren't using NIS, but
somehow you've started poking around at various pieces of NIS without
realizing it.  And you've also mixed up command names and filenames.

> So I must have screwed something up with that edit, but how do I fix it?

What *exactly* are you trying to do?

Are you trying to set your default DNS domain name, which is used to
search for fully qualified hostnames when you only type partial hostnames?

E.g. let's pretend you work for a company named Neener and they use the
domain name neener.com for their internal hosts.  You're at your desk
in the Neener HQ, and you're using a Unix workstation that they've set
up for you.  It has the hostname "ws43", or "ws43.neener.com".

Now, you want to ssh into your coworker's workstation, which has the
hostname "ws31", or "ws31.neener.com".

Since it isn't the 1980s, your workplace has set up a DNS infrastructure
that lets you obtain the IP address of ws31.neener.com (and all the other
workstations, servers, and so on).  So, if you were to type
"ssh ws31.neener.com", that would work.  You'd get the IP address of
ws31.neener.com from DNS, and you'd connect to the correct workstation.

But that's a lot of typing.  So your workplace has also arranged things
so that you can simply type "ssh ws31", and that will also work.

How does that work?

In the file /etc/resolv.conf there are several different kinds of lines
that may be present.  One of them is the "search" line.

If the resolv.conf file contains the line "search neener.com", this means
any hostname that you try to resolve which doesn't contain a dot will
get ".neener.com" appended to it.  So, when you try to resolve "ws31",
the DNS resolver library will automatically try "ws31.neener.com" for
you.

So, the next question is, "How can I put the line search neener.com into
my /etc/resolv.conf file?"  In a sane, sensible universe, it would be
easy -- you would just edit the file with a text editor, and that would
be the end of it.

But we do not live in that universe.

The /etc/resolv.conf file is continually, automatically rewritten by a
plethora of programs that all think they know what you want.  They're
all wrong, of course, but you can't make the developers understand that.
Your changes to the /etc/resolv.conf file will be overwritten, probably
within an hour.

At this point, please read <https://wiki.debian.org/resolv.conf> to see
what your options are, for making permanent changes to resolv.conf.  It's
really stupidly complicated, and there's no point in my repeating it
all here.

THAT is how you set your default DNS domain name, and THAT is what it
means to have a default DNS domain name in the first place.  It's not
about your own hostname.  It's about shortening what you have to type
when you resolve *other* hostnames within your organization's namespace.

[toc] | [prev] | [next] | [standalone]


#232026

FromTom Browder <tom.browder@gmail.com>
Date2021-02-24 15:00 +0100
Message-ID<BM2RP-6Wu-3@gated-at.bofh.it>
In reply to#232024

[Multipart message — attachments visible in raw view] — view raw

On Wed, Feb 24, 2021 at 07:44 Greg Wooledge <greg@wooledge.org> wrote:

> Gene Heskett (gheskett@shentel.net) wrote:
> > But wtf? I have edited "sudo nano" /etc/domainname, did not set the i
> > bit, and the edit is still there, but asking for it is (none)

...

For my LAN hosts as well as my WLAN hosts, I have always used the
/etc/hosts file and have never touched the default /etc/resolv.con file.

I have never had any problems with connecting to any of those hosts except
when  adding a new host snd needing to get ssh installed.

-Tom

[toc] | [prev] | [next] | [standalone]


#232027

FromGreg Wooledge <greg@wooledge.org>
Date2021-02-24 15:20 +0100
Message-ID<BM3bb-7i3-3@gated-at.bofh.it>
In reply to#232026
Tom Browder (tom.browder@gmail.com) wrote:
> For my LAN hosts as well as my WLAN hosts, I have always used the
> /etc/hosts file and have never touched the default /etc/resolv.con file.
> 
> I have never had any problems with connecting to any of those hosts except
> when  adding a new host snd needing to get ssh installed.

This is how things were configured in the early 1980s.  It works, as
long as you can maintain all of those copies of your hosts file, across
however many machines you have.

The disadvantages should be clear.  Every time you add a new host,
you have to go and edit the hosts file on *every other* host, so they
all know about the new guy.  Each time a host moves and gets a new IP
address, you have to edit *every* single hosts file.  And so on.

With a small number of hosts, with no changes occurring, you may be fine,
and you'll never need to change how you work.

For everyone else, there's DNS.

[toc] | [prev] | [next] | [standalone]


#232030

FromTom Browder <tom.browder@gmail.com>
Date2021-02-24 15:30 +0100
Message-ID<BM3kR-7l3-7@gated-at.bofh.it>
In reply to#232027

[Multipart message — attachments visible in raw view] — view raw

On Wed, Feb 24, 2021 at 08:11 Greg Wooledge <greg@wooledge.org> wrote:

> Tom Browder (tom.browder@gmail.com) wrote:
> > For my LAN hosts as well as my WLAN hosts, I have always used the
> > /etc/hosts file and have never touched the default /etc/resolv.con file.
> >
> > I have never had any problems with connecting to any of those hosts
> except
> > when  adding a new host snd needing to get ssh installed.
>
> This is how things were configured in the early 1980s.  It works, as
> long as you can maintain all of those copies of your hosts file, across
> however many machines you have.
>
> The disadvantages should be clear.  Every time you add a new host,
> you have to go and edit the hosts file on *every other* host, so they
> all know about the new guy.  Each time a host moves and gets a new IP
> address, you have to edit *every* single hosts file.  And so on.


I'm not arguing with you, just saying it works for me and has for many
years (since I was with my former employer when we had our first LAN hookup
with coax cable in 1994ish with SGI hosts mixed with Windows PCs and Redhat
Linux PCs). The most hosts we ever had was about 30 and several of us
shared sysadmin duties.

I've continued that way on my own private network. Gene can probably do the
same.

The "real" way to do it is of course necessary for modern "real" networks
with dedicated sysadmin staff members.

Best regards,

-Tom

[toc] | [prev] | [next] | [standalone]


#232042

FromGene Heskett <gheskett@shentel.net>
Date2021-02-24 18:30 +0100
Message-ID<BM693-z6-3@gated-at.bofh.it>
In reply to#232024
On Wednesday 24 February 2021 08:44:06 Greg Wooledge wrote:

> Gene Heskett (gheskett@shentel.net) wrote:
> > But wtf? I have edited "sudo nano" /etc/domainname, did not set the
> > i bit, and the edit is still there, but asking for it is (none)
>
> There is no such file on my system.  What made you think that you
> should create this file?  What program did you think would use it?
>
> > domainname domain.name changes it only for this boot, a reboot
> > clears it to (none) again.
>
>        domainname - show or set the system's NIS/YP domain name
>
> Are you using NIS?  If you are, you should be configuring the NIS
> domain name in the file /etc/defaultdomain (which is read by
> /etc/init.d/nis which is what the systemd unit points to, because
> apparently Debian's NIS packaging is not fully updated for systemd).
>
> But I think you're actually just confused, and you aren't using NIS,
> but somehow you've started poking around at various pieces of NIS
> without realizing it.  And you've also mixed up command names and
> filenames.
>
> > So I must have screwed something up with that edit, but how do I fix
> > it?
>
> What *exactly* are you trying to do?
>
> Are you trying to set your default DNS domain name, which is used to
> search for fully qualified hostnames when you only type partial
> hostnames?
>
> E.g. let's pretend you work for a company named Neener and they use
> the domain name neener.com for their internal hosts.  You're at your
> desk in the Neener HQ, and you're using a Unix workstation that
> they've set up for you.  It has the hostname "ws43", or
> "ws43.neener.com".
>
> Now, you want to ssh into your coworker's workstation, which has the
> hostname "ws31", or "ws31.neener.com".
>
> Since it isn't the 1980s, your workplace has set up a DNS
> infrastructure that lets you obtain the IP address of ws31.neener.com
> (and all the other workstations, servers, and so on).  So, if you were
> to type
> "ssh ws31.neener.com", that would work.  You'd get the IP address of
> ws31.neener.com from DNS, and you'd connect to the correct
> workstation.
>
> But that's a lot of typing.  So your workplace has also arranged
> things so that you can simply type "ssh ws31", and that will also
> work.
>
> How does that work?

By looking its alias up in /etc/hosts.

> In the file /etc/resolv.conf there are several different kinds of
> lines that may be present.  One of them is the "search" line.
2 lines in that real file.

search coyote.den
dnsserver ipv4 address

which is the local domain name. And that does show up in the 
dnsdomainname report. That just started working but I've no clue why.

> If the resolv.conf file contains the line "search neener.com", this
> means any hostname that you try to resolve which doesn't contain a dot
> will get ".neener.com" appended to it.  So, when you try to resolve
> "ws31", the DNS resolver library will automatically try
> "ws31.neener.com" for you.
>
> So, the next question is, "How can I put the line search neener.com
> into my /etc/resolv.conf file?"  In a sane, sensible universe, it
> would be easy -- you would just edit the file with a text editor, and
> that would be the end of it.
>
> But we do not live in that universe.
>
It hasn't existed since Pottering came on the scene...
So its not a mystery link to something resolveconf might conjure up, and 
if it gets changed, NM is famous for that, so it gets restored and a +i 
applied.

> The /etc/resolv.conf file is continually, automatically rewritten by a
> plethora of programs that all think they know what you want.  They're
> all wrong, of course, but you can't make the developers understand
> that. Your changes to the /etc/resolv.conf file will be overwritten,
> probably within an hour.
>
> At this point, please read <https://wiki.debian.org/resolv.conf> to
> see what your options are, for making permanent changes to
> resolv.conf.  It's really stupidly complicated, and there's no point
> in my repeating it all here.
>
I just read it, Stupid is not an adequate description.

> THAT is how you set your default DNS domain name, and THAT is what it
> means to have a default DNS domain name in the first place.  It's not
> about your own hostname.  It's about shortening what you have to type
> when you resolve *other* hostnames within your organization's
> namespace.

Well, its now working. If I suddenly develop a bad case of the 
169.it.is.flu in my routing table, synaptic won't let me remove avahi or 
nm without totally destroying the system, but nothing complains if I 
nuke the binaries.

avahi and nm may be solutions a lappy user might need. Damned little is 
portable here without a multi-ton gantry crane. They are both just 
problems waiting to bite me, and to be emasculated by whatever means it 
takes.

My network was built by me, nothing portable about it, and I don't 
understand why a dirt simple, static, /etc/hosts based local network, is 
so damned hard to actually make work. It doesn't need a dns server other 
than using the router as a relay to my isp's server, or anything 
associated with dhcp, and I don't really appreciate haveing all this 
laptop crap forcibly installed when it does nothing for me but screw 
things up. Funny thing happens when its all running my way, I can go to 
any machine on my local net, fire up firefox and go visit any site on 
the planet as long as my isp's dns server can look it up. It all just 
works without all the lappy BS. Sure FF is a little slow on the rpi4b, 
but it still works 100%.  That rpi4b is running an 80 yo medium sized 11 
by 54 inch Sheldon metal lathe, that weighs 3/4 ton, at speeds no 
machinist can match doing it by hand. Portable its not.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>

[toc] | [prev] | [next] | [standalone]


#232044

FromGreg Wooledge <greg@wooledge.org>
Date2021-02-24 19:00 +0100
Message-ID<BM6C6-L8-9@gated-at.bofh.it>
In reply to#232042
Gene Heskett (gheskett@shentel.net) wrote:
> > What *exactly* are you trying to do?

(crickets chirping)

> > How does that work?
> 
> By looking its alias up in /etc/hosts.

I was using rhetorical devices.  If you're truly using a pre-DNS
local network, then a lot of what I said simply does not apply to you.

> > In the file /etc/resolv.conf there are several different kinds of
> > lines that may be present.  One of them is the "search" line.
> 2 lines in that real file.
> 
> search coyote.den
> dnsserver ipv4 address

Your first line is valid.  Your second line is not.  There is no
keyword "dnsserver" in resolv.conf(5).  DNS resolvers are listed here
using the keyword "nameserver".

> It hasn't existed since Pottering came on the scene...

DHCP client daemons overwriting resolv.conf predate systemd by a lot.
This is not a thing that systemd can be blamed for.

> avahi and nm may be solutions a lappy user might need. Damned little is 
> portable here without a multi-ton gantry crane. They are both just 
> problems waiting to bite me, and to be emasculated by whatever means it 
> takes.

If you don't need them, delete them.

> My network was built by me, nothing portable about it, and I don't 
> understand why a dirt simple, static, /etc/hosts based local network, is 
> so damned hard to actually make work.

It's not!

Is that what you want?  A local network defined entirely by hosts files?
You can do that.  It's easy.  Just edit your /etc/hosts files to contain
the names and addresses of your machines.

In this scenario, your resolv.conf file will be used only to look up
hosts that live outside of your local network ("in the cloud").  You
won't CARE what the default DNS domain name is, because you aren't using
it.  Your local host lookups will be done by matching the strings that
you put in your hosts files.

Since you don't care what your resolv.conf file contains, you don't need
to jump through all the hoops involved in trying to prevent daemons from
overwriting it.  Let them.  Ignore them.  Your hostnames are defined in
your hosts files, and nothing will touch those.

[toc] | [prev] | [next] | [standalone]


#232048

FromIL Ka <kazakevichilya@gmail.com>
Date2021-02-24 19:20 +0100
Message-ID<BM6Vs-195-5@gated-at.bofh.it>
In reply to#232044

[Multipart message — attachments visible in raw view] — view raw

>
>
> Is that what you want?  A local network defined entirely by hosts files?
> You can do that.  It's easy.  Just edit your /etc/hosts files to contain
> the names and addresses of your machines.
>
> In this scenario, your resolv.conf file will be used only to look up
> hosts that live outside of your local network ("in the cloud").  You
> won't CARE what the default DNS domain name is, because you aren't using
> it.  Your local host lookups will be done by matching the strings that
> you put in your hosts files.
>


IMHO: "hosts" files could only be used in the network that uses static IP
addresses.
In this case neither DHCP client nor NetworkManager should be used, so
nothing should touch ``resolve.conf``.
And that means the DNS server could be used.

Sysadmin simply runs DNS server for the "younetwork.name" domain, adds "A"
record for each PC manually, and
then adds "nameserver" and "domain" to the "resolve.conf" on each station.
Latter is required to access "pc1.yournetwork.name" as "pc1".

To rename a machine one can simply change "A" record on DNS and "hostname"
on station.
All changes are persistent, because nothing overwrites resolve.conf

Changing name in two places (station and DNS) is easier than changing it on
all "hosts" files across your network.

[toc] | [prev] | [next] | [standalone]


#232046

FromCelejar <celejar@gmail.com>
Date2021-02-24 19:00 +0100
Message-ID<BM6C6-L8-15@gated-at.bofh.it>
In reply to#232042
On Wed, 24 Feb 2021 12:25:34 -0500
Gene Heskett <gheskett@shentel.net> wrote:

> On Wednesday 24 February 2021 08:44:06 Greg Wooledge wrote:
> 
> > Gene Heskett (gheskett@shentel.net) wrote:

...

> > So, the next question is, "How can I put the line search neener.com
> > into my /etc/resolv.conf file?"  In a sane, sensible universe, it
> > would be easy -- you would just edit the file with a text editor, and
> > that would be the end of it.
> >
> > But we do not live in that universe.
> >
> It hasn't existed since Pottering came on the scene...

Not everything is systemd's fault - this craziness predates systemd, as
explained in https://wiki.debian.org/resolv.conf, mentioned by Greg
below.

> So its not a mystery link to something resolveconf might conjure up, and 
> if it gets changed, NM is famous for that, so it gets restored and a +i 
> applied.
> 
> > The /etc/resolv.conf file is continually, automatically rewritten by a
> > plethora of programs that all think they know what you want.  They're
> > all wrong, of course, but you can't make the developers understand
> > that. Your changes to the /etc/resolv.conf file will be overwritten,
> > probably within an hour.
> >
> > At this point, please read <https://wiki.debian.org/resolv.conf> to
> > see what your options are, for making permanent changes to
> > resolv.conf.  It's really stupidly complicated, and there's no point
> > in my repeating it all here.

Celejar

[toc] | [prev] | [next] | [standalone]


#232000

FromGene Heskett <gheskett@shentel.net>
Date2021-02-24 02:10 +0100
Message-ID<BLQQF-8fP-3@gated-at.bofh.it>
In reply to#231991
On Tuesday 23 February 2021 14:29:01 Tom Browder wrote:

> On Tue, Feb 23, 2021 at 11:59 AM Gene Heskett <gheskett@shentel.net>
> wrote: ...
>
> > Nothing I do survives a reboot, so what do I do to actually rename
> > the machine and make it stick? Hopefully without losiing the
> > networking
>
> Hey, Gene.  I usually have to fiddle around a little, but I've always
> had success on Debian this way (as root):
>
>     # hostname TLM
>
>    edit /etc/hostname and set the desired name to TLM if it's not
> already changed
>
> I also edit /etc/hosts and make the first couple of lines look like
> this:
>
>     127.0.0.1 localhost.localdomain.com   localhost
>     127.0.1.1 TLM.geneslinuxbox.net        TLM

The first line is std here.

Why should it have the 2nd one?

> Then reboot and cross your fingers.

Arthritis at 86 is beginning to make that painful. :(
>
> Blessings,
>
> -Tom
>
> P.S. Keep your powder dry!

Absolutely. I may yet live to see the last box opened.


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>

[toc] | [prev] | [next] | [standalone]


#232003

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2021-02-24 02:40 +0100
Message-ID<BLRjH-8oK-1@gated-at.bofh.it>
In reply to#232000
On Tue 23 Feb 2021 at 20:05:11 (-0500), Gene Heskett wrote:
> On Tuesday 23 February 2021 14:29:01 Tom Browder wrote:
> > On Tue, Feb 23, 2021 at 11:59 AM Gene Heskett wrote: ...
> >
> > > Nothing I do survives a reboot, so what do I do to actually rename
> > > the machine and make it stick? Hopefully without losiing the
> > > networking
> >
> > Hey, Gene.  I usually have to fiddle around a little, but I've always
> > had success on Debian this way (as root):
> >
> >     # hostname TLM
> >
> >    edit /etc/hostname and set the desired name to TLM if it's not
> > already changed
> >
> > I also edit /etc/hosts and make the first couple of lines look like
> > this:
> >
> >     127.0.0.1 localhost.localdomain.com   localhost
> >     127.0.1.1 TLM.geneslinuxbox.net        TLM
> 
> The first line is std here.
> 
> Why should it have the 2nd one?

If some software wants to know the IP address of TLM before the
network is up, there's no point in handing it 192.168.M.N,
so you use a loopback address to itself.

However, putting TLM on the first line can apparently make
localhost.localdomain into the canonical name of the system,
which is probably not what you want.

BTW I don't know where your .com came from in the first line.

Cheers,
David.

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | linux.debian.user


csiph-web