Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #232011
| From | <tomas@tuxteam.de> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: Got a machine name problem |
| Date | 2021-02-24 09:40 +0100 |
| Message-ID | <BLXS9-3Yj-1@gated-at.bofh.it> (permalink) |
| References | <BLK8x-3Vl-3@gated-at.bofh.it> <BLLxD-4YR-3@gated-at.bofh.it> <BLQdX-7Np-3@gated-at.bofh.it> <BLRa1-8lO-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[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
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
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
csiph-web