Articles in this section

/etc/resolv.conf does not hold changes on the server with Plesk

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

  • System overwrites the changes in the /etc/resolv.conf file

  • The file /etc/resolv.conf contains the following warning:

    CONFIG_TEXT: # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
    # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
    # 127.0.0.53 is the systemd-resolved stub resolver.
    # run "resolvectl status" to see details about the actual nameservers.
    nameserver 127.0.0.53

  • Plesk is unable to resolve external hosts, separate DNS zones of domains or separate DNS records within the DNS zones of domains

Cause

There are three known possible causes for this behavior:

  • NetworkManager is used
  • systemd-resolved overwrites the changes in the /etc/resolv.conf file
  • Custom DNS resolvers are used and they are unable to resolve certain domains for unknown reasons

Resolution

Warning: Since /etc/resolv.conf and /etc/systemd/resolved.conf contents are not part of the Plesk configuration and are to be selected by the server or network administrator, it is highly recommended to contact the administrator of your network service before performing any of the operations listed below.

Apply one of the following solutions:

Make adjustments in the /etc/systemd/resolved.conf file by following these steps:
  1. Log into your server via SSH

  2. Edit the /etc/systemd/resolved.conf.

  3. Add at least one reliable open DNS resolver such as 8.8.8.8, 8.8.4.4 (Google), 1.1.1.1, 1.0.0.1 (Cloudflare) to the beginning of the list

  4. Save the changes
    For example, the adjusted /etc/systemd/resolved.conf file would have the following content:

    CONFIG_TEXT: [Resolve]
    DNS=8.8.8.8 203.0.113.2 203.0.113.3

  5. Restart the systemd-resolved service by executing the following command:

    # systemctl restart systemd-resolved

  6. Run the following command in order to confirm that the changes have been applied:

    # resolvectl status

    If you see the newly added DNS resolver to the list of results, you have been successful.

Consult with your network administrator if `systemd-resolved` can be disabled by following these steps:
  1. Log into your server via SSH

  2. Execute the following command:

    # systemctl disable systemd-resolved && systemctl stop systemd-resolved

  3. Configure the DNS resolvers you would like to use directly in the /etc/resolv.conf file, Vi editor can be used for this.

    Note: Make sure to add at least one reliable open DNS resolver such 8.8.8.8, 8.8.4.4 (Google), 1.1.1.1, 1.0.0.1 (Cloudflare) to the beginning of the list

  4. Save the changes
    For example, the adjusted /etc/resolv.conf file would have the following content:

    CONFIG_TEXT: nameserver 8.8.8.8
    nameserver 203.0.113.2
    nameserver 203.0.113.3

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.