From Fedora Project Wiki

No edit summary
No edit summary
Line 1: Line 1:
== How to change the hostname ==
== How to change the hostname ==
With Fedora 18 the hostname is stored in the file <code>/etc/hostname</code>. During the boot process the transient hostname will be set from <code>systemd</code> according to the content of the file <code>/etc/hostname</code>.
With Fedora 18 the hostname is stored in the file <code>/etc/hostname</code>. During the boot process the transient hostname will be set from [http://www.freedesktop.org/wiki/Software/systemd/ systemd] according to the content of the file <code>/etc/hostname</code>.
The commands '''hostname''' and '''hostnamectl''' may be used to print or set the system hostname.
The commands '''hostname''' and '''hostnamectl''' may be used to print or set the system hostname.
On Fedora the system hostname is specified as a '''f'''ully '''q'''ualified '''d'''omain '''n'''ame (FQDN).
On Fedora the system hostname is specified as a '''f'''ully '''q'''ualified '''d'''omain '''n'''ame (FQDN). The following command changes the transient and static hostname:
<pre>
<pre>
hostnamectl set-hostname myhost.mydomain
hostnamectl set-hostname myhost.mydomain
</pre>
</pre>

Revision as of 08:08, 20 May 2015

How to change the hostname

With Fedora 18 the hostname is stored in the file /etc/hostname. During the boot process the transient hostname will be set from systemd according to the content of the file /etc/hostname. The commands hostname and hostnamectl may be used to print or set the system hostname. On Fedora the system hostname is specified as a fully qualified domain name (FQDN). The following command changes the transient and static hostname:

hostnamectl set-hostname myhost.mydomain