2

I'm using CentOS 5. How do I change the hostname of the machine so I can ssh to it from other boxes by a short hostname? I've tried "hostname puppet", changing "/etc/sysconfig/network" and "sysctl kernel.hostname=puppet". I'd like to be able to do this without making changes to any hostfiles.

Thanks.

2 Answers 2

3

You either have to setup a local DNS server or you will have to change hostfiles. The changes you did will work, only to be identified in the local system and not from other systems.

7
  • So it won't work with a basic home router?
    – Jon Haddad
    Jan 30, 2010 at 5:25
  • I can hit my Mac from another computer by typing in "ping haddad-desktop". Why would this work and not the changes on the linux box?
    – Jon Haddad
    Jan 30, 2010 at 5:31
  • It might be doing so with the help of NETBIOS/WINS thing. I am not too much into windows to explain that.
    – proy
    Jan 30, 2010 at 5:36
  • I rebooted the box after changing "/etc/sysconfig/network" and it seems to be working. I also did the sysctl command, so I'm not sure which one would have done it.
    – Jon Haddad
    Jan 30, 2010 at 6:08
  • 1
    .local is mDNS, which is implemented for Linux as avahi-daemon Jan 30, 2010 at 14:22
1

no need to reboot

1 /etc/hosts

2 /etc/sysconfig/network

3 /bin/hostname

$su -c service syslog restart

logout

login

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .