Linux Tutorials - Herong's Tutorial Examples - v5.45, by Herong Yang
Reset Host Name on Linux Systems
This section provides a tutorial example on how to view and change host name settings on Linux systems.
After installing a new Linux system, you want to check and reset its host name with more meaningful name.
1. View the current host name using the "hostname" command. I see the default host name "localhost.localdomain" on my CentOS computer.
herong$ hostname localhost.localdomain
2. Reset the host name with "hostnamectl set-hostname" command. "mail" is used to identify this computer as the Mail server.
herong$ sudo hostnamectl set-hostname mail herong$ hostname mail
3. Look at hostname file on the system. You can actually set the host name by editing this file.
herong$ sudo more /etc/hostname mail
4. Map host name to IP address.
herong$ sudo vi /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.1.100 mail.herongyang.com mail
Table of Contents
Cockpit - Web Portal for Administrator
Install CentOS from Bootable USB
Install CentOS by Deleting Existing Partition
Reset Timezone on Linux Systems
►Reset Host Name on Linux Systems
SELinux - Security-Enhanced Linux
SSH Protocol and ssh/scp Commands
Software Package Manager on CentOS - DNF and YUM
vsftpd - Very Secure FTP Daemon