[NTLUG:Discuss] Re: Renaming a Linux host

Burton Strauss Burton_Strauss at comcast.net
Tue Jul 26 07:10:34 CDT 2005


 

-----Original Message-----
From: discuss-bounces at ntlug.org [mailto:discuss-bounces at ntlug.org] On Behalf
Of Leroy Tennison
Sent: Tuesday, July 26, 2005 3:08 AM
To: NTLUG Discussion List
Subject: Re: [NTLUG:Discuss] Re: Renaming a Linux host

<snip />

>OK, if it only changes the in-memory value, why does the program exist? 
> Surely there are other ways of setting the in-memory value, what pragmatic
other value does it have?

Because otherwise how do you set it during the boot??

Remember, the name value pairs in most of the configuration files are just
that - files.

HOSTNAME=magic

when executed, via . or source, will set the shell variable HOSTNAME to the
value magic.  That's it.  Various scripts then use that shell variable as
parameters to programs, etc., e.g.:

hostname ${HOSTNAME}

invokes the hostname program with the value of the parameter HOSTNAME, to
set the in-memory value.

The problem arises because there isn't just ONE name, value pair set.
Different programs require different parameters, and, well there's no single
all seeing boot god to make sure everyone does it the same way.

That's what makes Linux so much fun...


In general these are the normal 'names' of a host.

  hostname - usually (but not required to be) a single qualifier and the
name most of us mean when we talk about the hostname.
  fqdn - fully qualified domain name - the 'full' name, e.g.
magic.burtonstrauss.us, the name accessible on the Internet.

But there are (many) others...

  NetBIOS name - used by Windows'
  IPX name - used by the Novell IPX protocol
  NIS name - Network Information System (sort of a LAN white/yellow pages)
  /etc/hosts - used for (local) tcp/ip name resolution.  By convention,
localhost is always the well, local host address (127.0.0.1), and should be
aliased to the hostname, e.g.

# cat /etc/hosts
127.0.0.1       localhost magic magic.burtonstrauss.us

etc.

In general, the more stuff you have installed on the box, the more places
it's 'name' is set.

Also, newer distributions tend to have fewer 'name' locations, as we've all
learned the benefit of fewer places to fix.  Also, very roughly, the older
the original basis of the distribution the more hap-hazard it was (e.g.
Fedora, which traces back a number of years to RedHat isn't quite as singled
named as Gentoo).
 

-----Burton






More information about the Discuss mailing list