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

System Files /etc/hosts and /etc/resolv.conf Changed During Boot

edited Feb 20, 2024 4:05PM in Linux

Applies To:

Oracle Cloud Infrastructure - Version N/A and later

Linux x86-64 on Oracle Public Cloud

Symptoms:

The system files /etc/hosts and /etc/resolv.conf file were changed during boot, loosing customization.

Cause:

By default, OCI services and dhclient will set /etc/hosts and /etc/resolv.conf at boot.

Solution:

To prevent the system to modify the hostname and the /etc/hosts change the setting file /etc/oci-hostname.conf to:

PRESERVE_HOSTINFO=2

Even with this setting, /etc/resolv.conf will still be re-written during boot with this setting.

To prevent changes to this file, the /etc/resolv.conf

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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