Setting the hostname in Fedora 18

      No Comments on Setting the hostname in Fedora 18

Staring with Fedora 18, the hostname is longer set it /etc/sysconfig/network but in /etc/hostname. To manipulate the hostname there’s a small tool named hostnamectl which is part of Fedora’s systemd package.

The following table (taken from the Fedora 18 Release Notes) shows a few basic hostnamectl commands to set or change a host’s name:

CommandFunction
hostnamectl set-hostname fedorasystem --prettySet pretty hostname.
hostnamectl set-hostname fedorasystem.example.org --staticSet static hostname.
hostnamectl set-hostname fedora-dhcp-client.example.org --transientSet transient hostname.
hostnamectl set-hostname fedorasystem.example.orgWithout arguments, hostnamectl will apply to all hostname types.
hostnamectl statusShow current hostname settings

See also hostnamectl manpage.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.