-->

DEVOPSZONES

  • Recent blogs

    How to make Permanent change in OCI: System Files /etc/resolv.conf

     Sometimes If you have  to set custom search domain in OCI Compute Insrtances. You need set them in the "/etc/resolv.conf". But that is not going to be permanent, as By default, OCI services and dhclient will set /etc/hosts and /etc/resolv.conf at boot. 


    To prevent changes to this file, the /etc/resolv.conf need to have the following content: docs.cloud.oracle.com. So if the file is customize remember to keep that string.

    The default OCI /etc/resolv.conf is:

    ; Any changes made to this file will be overwritten whenever the
    ; DHCP lease is renewed. To persist changes you must update the
    ; /etc/oci-hostname.conf file. For more information see
    ;[https://docs.cloud.oracle.com/iaas/Content/Network/Tasks/managingDHCP.htm#notes]
    ;
    ; generated by /usr/sbin/dhclient-script
    search <DOMAIN> <SUBNET>.<VCN>.oraclevcn.com <VCN>.oraclevcn.com
    nameserver 169.254.169.254

     

    Also, dhclient don't change file if the network interfaces configuration files (/etc/sysconfig/network-scripts/ifcfg-*) contain:

    PEERDNS=no


    OCI resolv.conf
    OCI resolv.conf

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

    PRESERVE_HOSTINFO=2

    For More info on  Permanently Change Hostname in Oracle Cloud Infrastructure (OCI) Compute Environment on Oracle Linux 


    No comments