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

Re: hostname must tally with fqdn in /etc/hosts?



On Thursday 2008 November 20 06:29, Umarzuki Mochlis wrote:
> Why that must be, I mean when changing the hostname with hostname command,
> we also sometimes need to do the same with /etc/hosts else something weird
> would happen. Does the command hostname writes somewhere else other than
> /etc/hosts?

The hostname command just updates what the kernel thinks the hostname is.  It 
doesn't modify any file.  (If you want the change to be "permanent", 
update /etc/hostname; Debian does 'hostname "$(cat /etc/hostname)"' during 
the boot process.)  A running instance of Debian only has one of these at a 
time.  The kernel's hostname string is a very local identifier.

The FQDN is a more complicated beast, dependent on your NSS settings and the 
resources they point to, and a single running Debian instance might have many 
of them.  The FQDN is supposed to be a global identifier for the system and, 
in general, neither the system itself or the system's administrator has the 
ability or permissions to change it.  But for most people, 
updating /etc/hosts will make their machine report the FQDN they expect.
-- 
Boyd Stephen Smith Jr.                     ,= ,-_-. =. 
bss03@volumehost.net                      ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' 
http://iguanasuicide.org/                      \_/     

Attachment: pgpUVfKtNJvNm.pgp
Description: PGP signature


Reply to: