1. Home
  2. Configuring
  3. Preventing NetworkManager from Overwriting /etc/resolv.conf on RHEL Compute Nodes
  1. Home
  2. Software Management
  3. Preventing NetworkManager from Overwriting /etc/resolv.conf on RHEL Compute Nodes

Preventing NetworkManager from Overwriting /etc/resolv.conf on RHEL Compute Nodes

With RHEL/Rocky Linux 8 and later releases that are being used by software images for compute nodes, you may find that the NetworkManager service is overwriting the /etc/resolv.conf file on the compute node after it has been provisioned by the BCM node installer.

For example:

[root@hpc077 ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search local

If this is happening on a compute node, then a configuration file for NetworkManager may be created in the /etc/NetworkManager/conf.d/ directory on the node’s software image that will tell NetworkManager not to manage /etc/resolv.conf. The following commands may be run on the active head node to create such a file for a given software image:

# cat < /cm/images//etc/NetworkManager/conf.d/90-dns-none.conf
[main]
dns=none
EOF

Replace with the name of the software image. Similarly, if the path for the software images on the cluster is not /cm/images/, then you should also replace /cm/images/ with the path that you are using.

For example, if the name of the software image is “compute”, then you would run these commands:

# cat < /cm/images/compute/etc/NetworkManager/conf.d/90-dns-none.conf
[main]
dns=none
EOF

Then, the compute node may be rebooted over the network so that it gets reprovisioned by the BCM node installer. The node installer will generate the /etc/resolv.conf file on the compute node using the nameserver and search domain settings that you have specified in BCM. When the node comes online, /etc/resolv.conf will no longer be getting overwritten by the NetworkManager service.

Updated on January 22, 2025

Related Articles