Different Linux distros have different method to set the hostname. On Fedora Linux, it is quite simple.
On newer Fedora releases ∞
At least from Fedora 19 (sorry, no sure the exact earliest version):
You need to edit the file
/etc/hostname which just contains the hostname.
On older Fedora releases ∞
Sorry, I do not know the exact version till which you need to use the above method. At least from Fedora 12 to Fedora 17, you need to use this method.
On Fedora, you need to use this method.
# vim /etc/sysconfig/network
Find the line starting with
Assign the hostname for this computer to this variable. For example, to set the hostname to ericpc.fclose.com, just set
Save the file and it should take effect. If the machine uses the network service, restarting the network may be needed:
# service network restart
Latest posts by Eric Zhiqiang Ma (see all)
- Vim Tutorial for Beginners: vimtutor - Dec 31, 2016
- Essential Gnome Shell Extensions for Gnome 3 Users - Oct 22, 2016
- How to Install 32-bit Wine 1.8 on CentOS 7 - Oct 16, 2016