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