System Files /etc/hosts and /etc/resolv.conf Changed During Boot
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:
1