Chapter 21. Manually configuring the /etc/resolv.conf file

download PDF

By default, NetworkManager dynamically updates the /etc/resolv.conf file with the DNS settings from active NetworkManager connection profiles. However, you can disable this behavior and manually configure DNS settings in /etc/resolv.conf.


Alternatively, if you require a specific order of DNS servers in /etc/resolv.conf, see Configuring the order of DNS servers.

21.1. Disabling DNS processing in the NetworkManager configuration

By default, NetworkManager manages DNS settings in the /etc/resolv.conf file, and you can configure the order of DNS servers. Alternatively, you can disable DNS processing in NetworkManager if you prefer to manually configure DNS settings in /etc/resolv.conf.


  1. As the root user, create the /etc/NetworkManager/conf.d/90-dns-none.conf file with the following content by using a text editor:

  2. Reload the NetworkManager service:

    # systemctl reload NetworkManager

    After you reload the service, NetworkManager no longer updates the /etc/resolv.conf file. However, the last contents of the file are preserved.

  3. Optionally, remove the Generated by NetworkManager comment from /etc/resolv.conf to avoid confusion.


  1. Edit the /etc/resolv.conf file and manually update the configuration.
  2. Reload the NetworkManager service:

    # systemctl reload NetworkManager
  3. Display the /etc/resolv.conf file:

    # cat /etc/resolv.conf

    If you successfully disabled DNS processing, NetworkManager did not override the manually configured settings.


  • Display the NetworkManager configuration to ensure that no other configuration file with a higher priority overrode the setting:

    # NetworkManager --print-config

Additional resources

Red Hat logoGithubRedditYoutubeTwitter


Try, buy, & sell


About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.