How to change host name and FQDN of a Compute instance Oracle Cloud Infrastructure

How to change host name and FQDN of a Compute instance

https://community.oracle.com/customerconnect/discussion/637593/how-to-change-host-name-and-fqdn-of-a-compute-instance-doc-id-2779919-1

Applies to: 

Oracle Cloud Infrastructure

Goal

This document explains how to change the host name and fully qualified domain name (FQDN) of a Compute instance.

Solution

To change the hostname of an Oracle Linux pre 7 instance:

Edit “/etc/sysconfig/network” to change the parameter value for HOSTNAME.

For example:

# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME= <HOST NAME>

In the file “/etc/oci-hostname.conf” change the value of PRESERVE_HOSTINFO to 2.

/etc/oci-hostname.conf
PRESERVE_HOSTINFO=2

Reboot the operating system (OS), and after recovery, run the following command 

to confirm the updated hostname:

hostname

To change the hostname inside Oracle Linux 7, CentOS, and RHEL instances:

Tagged: 

发表评论