Setting the hostname in Fedora 18

I didn’t get to install the OS on my new laptop… oh yeah, I got a new laptop! It is awesome, and I will write about it somewhere.

Anyhow, I opted for Fedora 18, and the ZaReason folks installed it for me. It is nice having it ready to go, although it was funny to see some wierd name at the login…

I don’t have complex hard drive setups, so the only thing that I needed to set correctly was the hostname for this new machine. A bit harder than normal, since there were changes to how it works from Fedora 17. However, it is pretty easy to fix with a tool called hostnamectl.

Checking the status shows what the hostnames are set as:

[bash light=”true”]
[maiki@localhost ~]$ hostnamectl status
Static hostname: localhost.localdomain
Pretty hostname: n/a
Icon name: computer-laptop
Chassis: laptop
Machine ID: 69d27b356a94476da859461d3a3bc6fd
Boot ID: 1da3adf2786146f681afd9f9983c9f8d
Operating System: Fedora 18 (Spherical Cow)
CPE OS Name: cpe:/o:fedoraproject:fedora:18
Kernel: Linux 3.7.9-205.fc18.x86_64
Architecture: x86_64
[/bash]

My laptop designation is orenji, so I use:

[bash light=”true”]
[maiki@localhost ~]$ hostnamectl set-hostname orenji
[/bash]

Then another status shows:

[bash light=”true”]
[maiki@localhost ~]$ hostnamectl status
Static hostname: orenji
Pretty hostname: orenji
Icon name: computer-laptop
Chassis: laptop
Machine ID: 69d27b356a94476da859461d3a3bc6fd
Boot ID: 1da3adf2786146f681afd9f9983c9f8d
Operating System: Fedora 18 (Spherical Cow)
CPE OS Name: cpe:/o:fedoraproject:fedora:18
Kernel: Linux 3.7.9-205.fc18.x86_64
Architecture: x86_64
[/bash]

And of course if you open a new terminal, you will see your new hostname in the default prompt:

[bash light=”true”]
[maiki@orenji ~]$
[/bash]

2 thoughts on “Setting the hostname in Fedora 18”

Leave a Reply

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