Setting a Hostname in Linux April 11, 2018 Brandon Linux, Manuals, Server, Software 0 Log into the terminal with a user that possesses sudo privileges or as root Open, in vi the /etc/hostname file Press i to enter insert mode Delete the contents of the file and then type in the desired hostname. In my example I used fedora22 as the hostname Press Esc then :wq to save the file and quit vi Open the /etc/hosts file in vi and erase all the contents of the file Enter the IP of the local NIC, hit Tab, then the FQDN of the machine, Tab, and then the hostname of the machine Save and quit the file Reboot the machine
Leave a Reply