Note!! Please register for a free account to access the full content and also to participate in Q&A in the community
OCI: In Oracle Linux 7/CentOS 7 Instances, /etc/resolv.conf Gets Wiped After the First Reboot
in Linux
Applies To:
Oracle Cloud Infrastructure
Oracle Linux Server release 7
Symptoms:
The /etc/resolv.conf file is wiped out after the first reboot in Oracle Linux 7 /CentOS 7
Cause
The /etc/resolv.conf file is being overwritten because NetworkManager is managing the DNS configuration instead of the cloud-init script.
Solution
- Check the contents of /etc/resolv.conf and confirm that it is managed by the NetworkManager service.
[root@localhost ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search [DOMAIN_NAME]
nameserver 10.x.x.1
nameserver 10.x.x.2
options timeout:2
- Add manage_resolv_conf: false in a custom configuration file, such as /etc/cloud/cloud.cfg.d/99-persist-resolv-conf.cfg
Tagged:
0