OCI: Ubuntu Instance /etc/resolv.conf Is Overwritten at Boot Time
Oracle Cloud Infrastructure - Version N/A and later
/etc/resolv.conf custom entries get overwritten during boot.
Made an nameserver entry of
22.214.171.124 (a public DNS server on the internet) in /etc/resolv.conf, next day its gets automatically removed.
This file is managed by
systemd-resolved which overwrites the file to default value upon reboot or "
$ sudo cat /etc/resolv.conf # This file is managed by man:systemd-resolved(8). Do not edit. ... $
The manual page
/ETC/RESOLV.CONF Four modes of handling /etc/resolv.conf (see resolv.conf(5)) are supported: · systemd-resolved maintains the /run/systemd/resolve/stub-resolv.conf file for compatibility with traditional Linux programs. This file may be symlinked from /etc/resolv.conf. This file lists the 127.0.0.53 DNS stub (see above) as the only DNS server. It also contains a list of search domains that are in use by systemd-resolved. The list of search domains is always kept up-to-date. Note that /run/systemd/resolve/stub-resolv.conf should not be used directly by applications, but only through a