[NTLUG:Discuss] Re: Renaming a Linux host

Robert Citek rwcitek at alum.calberkeley.org
Mon Jul 25 00:47:53 CDT 2005


On Jul 24, 2005, at 11:15 PM, Leroy Tennison wrote:
> I was afraid someone was going to say something to that effect, it  
> never seems to be that easy.

Unfortunately, no it isn't.  One reason for the complexity is because  
a machine can have more than one name, or more correctly, one default  
name and several aliases per IP address.  Another reason is that  
there is more than one file/service that can store/query the name  
(e.g. sysctl, uname, hostname, /etc/hosts/, NIS, LDAP, DNS)

To give you an example of the diversity available, these different  
commands should give you the same result:

  # cat /proc/sys/kernel/hostname
  # sysctl kernel.hostname
  # uname -n
  # hostname

Anyone know of a good resource which explains the concept of  
hostname, aliases, and IP aliases?

> BTW, I'm running into problems with 'grep -R <hostname> *' on Red  
> hat 9.

While you can have '*' as the target to start your recursive grep, it  
is customary to give a single folder name.  For example,

  # hostname
  pleiades1

  # grep -R -i $(hostname) /etc/sysconfig/
  /etc/sysconfig/network:HOSTNAME=pleiades1

Regards,
- Robert
http://www.cwelug.org/downloads
Help others get OpenSource software.  Distribute FLOSS
for Windows, Linux, *BSD, and MacOS X with BitTorrent\




More information about the Discuss mailing list