Setting up CentOS – Set a hostname

Edit /etc/sysconfig/network and set the HOSTNAME field to the name of your server. Reboot, and the Bash prompt should now show the correct name of your server.
If you are also using a DHCP setup, you will need to edit another file to ensure that the correct name is reported to the DHCP server and entered into your DNS server.
Edit /etc/sysconfig/network-scripts/ifcfg-eth0 (replace eth0 with your appropriate network interface), and add DHCP_HOSTNAME with the correct hostname.

1 Comment

  1. Pierluigi VernettoI have changed hosnmate, on a CentOS 5.3 on VMWare player, but after the change the startup becomes extremely slow, even opening Terminal takes 30s . I have made sure the entry in the DNS tab in system-config-network is correct, and restarted . if I restore the previous hosnmate value (bagvapp) the respose times become normal again anybody experiencing the same problem?

Leave a Reply

Your email address will not be published.


*