In Fedora 18, the hostname is now stored in /etc/hostname rather then in the HOSTNAME= line /etc/sysconfig/network.
There are now three distinguished hostnames in use with Fedora 18.
- A high-level pretty free-form hostname
- The static hostname, i.e. the kernel hostname
- Possibly a transient temporary hostname
A pretty hostname can include all kinds of special characters, e.g. “Murphy’s Laptop”. There are few restrictions on the characters used. Note that the static and transient hostnames are limited to the usually accepted characters of Internet domain names.
A transient hostname might be assigned temporarily via a network configuration. The hostname might revert back to the static hostname if network connectivity is lost. It is only temporarily written to the kernel hostname.
To set the pretty hostname:
# hostnamectl set-hostname –pretty
To set the static hostname:
# hostnamectl set-hostname –static
To set the transient hostname:
# hostnamectl set-hostname –transient
To set the same hostname for all three:
# hostnamectl set-hostname
To see the hostname settings:
# hostnamectl status
The pretty hostname is stored in /etc/machine-info. See machine-id(5) for further information.