My Oracle Support Banner

Oracle Linux 7: How to Change System "hostname" (Doc ID 2312768.1)

Last updated on JULY 10, 2024

Applies to:

Linux OS - Version Oracle Linux 7.0 and later
Oracle Cloud Infrastructure - Version N/A and later
Linux x86-64


The following documentation explains how to change system hostname in Oracle Linux 7 

There are three classes of hostname: static, pretty, and transient.

Static: is the traditional hostname, which can be chosen by the user, and is stored in the /etc/hostname file.
Transient: is a dynamic host name maintained by the kernel. It is initialized to the static host name by default, whose value defaults to “localhost”. It can be changed by DHCP or mDNS at runtime.
Pretty: is a free-form UTF8 host name for presentation to the user. For example: "user's server" 


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document
 Method 1: using the NetworkManager text user interface tool 'nmtui'
 Method 2: using the NetworkManager command line tool 'nmcli' 
 Method 3: Setting the network configuration and hostname files as immutable
 Method 4: using 'hostnamectl' tool

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.