Este contenido no está disponible en el idioma seleccionado.

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


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.

Note

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.

Procedure

  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:

    [main]
    dns=none
    Copy to Clipboard
  2. Reload the NetworkManager service:

    # systemctl reload NetworkManager
    Copy to Clipboard
    Note

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

  3. Optional: Remove the Generated by NetworkManager comment from /etc/resolv.conf to avoid confusion.

Verification

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

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

    # cat /etc/resolv.conf
    Copy to Clipboard

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

Troubleshooting

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

    # NetworkManager --print-config
    ...
    dns=none
    ...
    Copy to Clipboard
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat, Inc.