Linux – Hostname problems in CentOS 5.5

centoslinuxlinux-networking

I just set up a CentOS 5.5 machine on my local network and attempted to modify the hostname by editing /etc/sysconfig/network file. When I'm logged in locally the change to the hostname is reflected and seems to be working fine. When I open a SSH session via PuTTY from Windows this is what I see at the prompt:

[root@? ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=mini.local
[root@? ~]# sysctl kernel.hostname
kernel.hostname = ?
[root@? ~]# hostname
?
[root@? ~]# hostname -f
hostname: Unknown server error

A couple of other symptoms that may be helpful in troubleshooting this problem. I can ping the CentOS box from my Windows machine via IP but not hostname. Also, my Netgear router does not display the hostname when I view the "Connected Devices", I do see the mac address and the proper IP listed though.

How can I make it so that the hostname is properly propagated throughout my network?

Best Answer

You need a DNS or setting the hosts file on every machine in your LAN.

Related Topic