[CentOS] Changing hostname?

Sat Sep 13 11:37:52 UTC 2008
William L. Maltby <CentOS4Bill at triad.rr.com>

On Sat, 2008-09-13 at 11:31 +0200, Niki Kovacs wrote:
> Marcus Moeller a écrit :
> > 
> > It should look like this:
> > 
> > 127.0.0.1       localhost.localdomain    localhost   calimero.local    calimero
> > 
> 
> When I do this, I get the following result (after rebooting):
> 
> [kikinovak at calimero ~]$ hostname
> calimero.local
> [kikinovak at calimero ~]$ hostname --fqdn
> localhost.localdomain
> 
> This looks weird to me.

IIRC, the 127.0.0.1 should normally have only the "localhost" thing.

$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain   localhost
::1     localhost6.localdomain6 localhost6

That's all I have in that file.

$ hostname
centos501.homegroannetworking

$ hostname --fqdn
centos501.homegroannetworking

$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
# VIA Technologies, Inc. VT6102 [Rhine-II]
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=xx:xx:xx:xx:xx:xx  # I've masked out MAC address for this post
ONBOOT=yes
DHCP_HOSTNAME=CentOS501
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes

If you are not getting your address from a DHCP server, there are minor
differences.

> <snip sig stuff>

HTH
-- 
Bill