change local hosto to name in centos command code example Example: centos change hostname # hostnamectl set-hostname your-new-hostname