Pages

Search This Blog

Wednesday, July 8, 2020

Permanently change the hostname of an Oracle Cloud Infrastructure (OCI) compute instance

For Oracle Linux 6:

1) Edit /etc/sysconfig/network
change the parameter value for "hostname"
example:
$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=instance-ol6
<--------- change here

2) In the file /etc/oci-hostname.conf change the value of PRESERVE_HOSTINFO to 2.
$cat /etc/oci-hostname.conf
PRESERVE_HOSTINFO=2


This change will be persistent across reboots.

For Oracle Linux 7:

1) Update the /etc/hostname file with below command.
    hostnamectl set-hostname <new name>

2) Edit the oci configuration file for hostnames as given below to update the needed value to 2 and save changes.
    $ vi /etc/oci-hostname.conf
    PRESERVE_HOSTINFO=2

  

3) Edit the FQDN from OCI console GUI, go to compute instances
--> select the instance
--> scroll down
--> at the left bottom corner select attached VNIC under resources
--> edit appropriate VNIC
--> change hostname to update FQDN
--> update VNIC

4) Reboot the instance

5) Check the hostname with hostname command.


1 comment:

  1. Best Bitcoin Casino Games | Slots Provider Review - Casinowowow
    The best Bitcoin casinos offer their players a wide variety of games which you 1xbet korean can try on any งานออนไลน์ mobile phone or 인카지노 tablet. Read our in-depth review to learn

    ReplyDelete