hostname - alex-aleyan/linux_wiki GitHub Wiki
-
Modify the
/etc/sysconfig/networkfile:NETWORKING=yes HOSTNAME=z_book_vm -
Replace the old hostname with the new one in
/etc/hostsfile:vim /etc/hosts -
Finally, use the
hostnamecommand to set your hostname:hostname z_book_vm -
Restart the network:
service network restart OR /etc/init.d/network restart # <-Equivalently you can use -
Verify that the hostname has changed:
hostname