hostname - alex-aleyan/linux_wiki GitHub Wiki
-
Modify the
/etc/sysconfig/network
file:NETWORKING=yes HOSTNAME=z_book_vm
-
Replace the old hostname with the new one in
/etc/hosts
file:vim /etc/hosts
-
Finally, use the
hostname
command 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