A reboot wiped the content of /etc/resolv.conf after configuring dns=none in NetworkManager.conf

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux (RHEL) 7
  • Red Hat Enterprise Linux (RHEL) 8
  • NetworkManager

Issue

  • On a RHEL 7 and RHEL 8 server using NetworkManager, configuring the directive dns=none in /etc/NetworkManager/NetworkManager.conf and immediately rebooting the server results in a wipe of the pre-existing content of /etc/resolv.conf.

Resolution

  • Restart the NetworkManager service before rebooting the server:

    # systemctl restart NetworkManager.service
    

Root Cause

  • Without a restart of the NetworkManager service the directive dns=none is still not in use in the loaded configuration.
  • NetworkManager will update the content of /etc/resolv.conf as part of its default behavior during the shutdown procedure.
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.