By default, NetworkManager on Red Hat Enterprise Linux (RHEL) 8 dynamically updates the
/etc/resolv.conf file with the DNS settings from active NetworkManager connection profiles. This section describes different options on how to disable this feature to manually configure DNS settings in
31.1. Disabling DNS processing in the NetworkManager configuration
This section describes how to disable DNS processing in the NetworkManager configuration to manually configure the
- As the root user, create the
/etc/NetworkManager/conf.d/90-dns-none.conffile with the following content by using a text editor: [main] dns=none
- Reload the
systemctl reload NetworkManagerNote After you reload the service, NetworkManager no longer updates the
/etc/resolv.conffile. However, the last contents of the file are preserved.
- Optionally, remove the
Generated by NetworkManagercomment from
/etc/resolv.confto avoid confusion.
- Edit the
/etc/resolv.conffile and manually update the configuration.
- Reload the
systemctl reload NetworkManager
- Display the
cat /etc/resolv.confIf you successfully disabled DNS processing, NetworkManager did not override the manually configured settings.
- For further details, see the description of the
dnsparameter in the
31.2. Replacing /etc/resolv.conf with a symbolic link to manually configure DNS settings
NetworkManager does not automatically update the DNS configuration if
/etc/resolv.conf is a symbolic link. This section describes how to replace
/etc/resolv.conf with a symbolic link to an alternative file with the DNS configuration.
rc-manageroption is not set to
file. To verify, use the
- Create a file, such as
/etc/resolv.conf.manually-configured, and add the DNS configuration for your environment to it. Use the same parameters and syntax as in the original
- Remove the
- Create a symbolic link named
/etc/resolv.confthat refers to
ln -s /etc/resolv.conf.manually-configured /etc/resolv.conf
- For details about parameters you can set in
/etc/resolv.conf, see the
- For further details about why NetworkManager does not process DNS settings if
/etc/resolv.confis a symbolic link, see the description of the
rc-managerparameter in the