From: roehling@debian.org
Hi Richard,
* Richard Lewis [2025-10-18
* 15:53]:
>I think the missing bit of explanation in this thread is: why would
>anyone know "apollo" but not "appollo.example.com"? both of these
>strings are written by the admin in /etc/hosts which is a file that has
>probably never been changed (and probably doesnt tell you anything much
>about reaching the system externally)
Good point.
The hostname ("apollo") can be configured in the kernel. The libc has
gethostname() and sethostname() functions to configure it, and there is
a hostname tool to do so from the shell. Usually, the hostname is stored
in /etc/hostname and set at boot time.
AFAIK the name is treated as an opaque string, so while Tradition tells
you to set the unqualified hostname, there is no technical reason why
you cannot set the fully qualified "apollo.example.com" as hostname. And
some people do that; I guess it is one of the contradicting traditions
Simon talked about elsethread.
>ie - what is the actual problem these settings are trying to solve?
A lot of software assumes that it can always resolve the local hostname
to an IP address (and vice versa look up the associated hostname of an
assigned IP address). That remains true even if you set the hostname
fully-qualified, so unless you have a permanent, reliable connection to
a DNS server that serves your domain, you probably want the /etc/hosts
entry; otherwise you may encounter random timeouts while interacting
with network daemons on your host.
Cheers
Timo
--
Timo Rhlin
9B03 EBB9 8300 DF97 C2B1 23BF CC8C 6BDD 1403
F4CA
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEEmwPruYMA35fCsSO/zIxr3RQD9MoFAmjzudMACgkQzIxr3RQD
9MqHxw//eGzEmO8R5DwE22/xHjAqA3EOIaad8AUwhk4q0nxW5WcA3iA9VKiwjwIm
ngwEwD8tpl+oq3L3r+diwQyKlttSrQ74ePZplsFs1TPzGcMp0DqQ0q80nntMOCUf
n/a3di4Va5BwoD2sTg1lkPKku41roiMR2B+jJJV83XrwHaRR7+xBfzolUps3/agy
Tgd1rtsgHUPkpXLc1oowvTzQUuTpNU56hNb+vB2l5ModviKxMX/d8e4NFp9DRPzD
apKFVKBIg8LNgJsWLx2ccMz10dhf/Mu2CqkOUzDIC1mBCQQvfJ7mlftOS5VxqvCk
C0OpkfEluKs2ZHoyakRvtvDh++vwmQB0Jn8RRYJ6IWdvbtCCMlb7Mh8EvEZSGZoB
jD4sZ8GRqjPndxBcmOtAlgP7YNHmWS6wy3EAk6Ee4JT15MmPnl775A/BKPXPdJZk
15hiZ2oRslH/twfEidm1zriV5eMyS9IISWkK4uDXvlg0dabvcLl+/aJbeISCWOiO
n6kNZHrtdvhM/i4E7gxu2u3K6j3KYvXhpBEaWtcFb6PxoovMDb+T1DeG8XsqbAOG
PdsmGRm6TDpmSRbOSV+ku/2Sv4Fm90zCCu1qmEtVMqZ1Wtre/+0srooEHTtanKCS
FFuxLXlohKZvvm9zVRdbUkWVT/kLHj90P6UIfrHLtjZfzKPDXso=
=1BoU
-----END PGP SIGNATURE-----
--- SoupGate-Win32 v1.05
* Origin: you cannot sedate... all the things you hate (1:229/2)
|