You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Setting PRESERVE_HOSTINFO=2 in /etc/oci-hostname.conf Does Not Prevent /etc/resolv.conf Overwrite

edited Jun 29, 2022 5:45PM in Linux

Applies to:

Oracle Cloud Infrastructure - Version N/A and later

Linux x86-64

Symptoms

On : OCI Linux instance

Setting PRESERVE_HOSTINFO=2 in /etc/oci-hostname.conf does not prevent /etc/resolv.conf to be overwritten at reboot or network restart.

The online help documents : https://docs.cloud.oracle.com/iaas/Content/Network/Tasks/managingDHCP.htm?Highlight=dhcp%20options

Any changes you make to the /etc/hosts and /etc/resolv.conf files will be overwritten whenever the DHCP lease is renewed or the instance is rebooted. To persist your changes, add the following line to /etc/oci-hostname.conf:

PRESERVE_HOSTINFO=2

Changes

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!