Hostname

How to change your server's hostname

The file /etc/sysconfig/network contains the hostname that you need to change. The file will look something like this:

NETWORKING="yes"
NETWORKING_IPV6=no
HOSTNAME="www.example.com"

This change won't take affect until the next reboot, but you can make the change happen immediately using the hostname command like so:

hostname ftp.example.com

You may also need to add/change the hostname in the /etc/hosts file. By default this should look something like this:

127.0.0.1  www.example.com localhost localhost.localdomain

Recent Updates

  • 2 years 3 days ago
  • 2 years 3 days ago
  • 2 years 5 days ago
    php 8.x
  • 2 years 6 days ago
    10.6.7
  • 2 years 1 week ago
    Drop Centos 5/6 stuff