Use the hostname command, but failure after restart
Vi / etc / sysconfig / network
Modify the HostName line, restart can also be effective