Ubuntu 18.04 DNS Fix

At Ubuntu 18.04 you may experience problems with dns resolving where dns requests are lost. Due to a problem with systemd-resolved local dns server it is possible that some dns requests are not always handled with the result that systemd-resolved does not send back dns information. This can impact the performance of your applications and the overall functioning of your system.

With the help of the explanation below you can identify whether your ubuntu installation has been affected by this bug.

  • First log in to your instance using ssh
  • View your resolv.conf configuration now
cat  /etc/resolv.conf

When you get back the below output you use the not working local dns solution.

# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "systemd-resolve --status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
search ams.resource.cloud

You can validate the problem with the test below. To do this, run the following command from the command line.

for SEQ in {1..250}; do echo -n '.' && curl -s http://ipv4.download.thinkbroadband.com/5MB.zip >/dev/null || echo $(date) "mislukt tijdens take ${SEQ}"; done ; echo 'klaar'

 

If you receive notifications in the above test and / or you have been able to validate that your resolv.conf uses the not working local dns, you can apply the following solution.

  • Enable systemd-resolved
systemctl enable systemd-resolved
  • Remove the old resolv configuration
rm /etc/resolv.conf
  • Create a new symlink and link /etc/resolv.conf to /run/systemd/resolve/resolv.conf
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
  • Check the contents of the resolv configuration
cat /etc/resolv.conf​

Content should be as below, but may vary depending on the configuration of your system.

# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known uplink DNS servers. This file lists all configured search domains.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 79.170.92.7
nameserver 194.60.207.53
nameserver 194.60.207.52
# Too many DNS servers configured, the following entries may be ignored.
nameserver 8.8.8.8
search ams.resource.cloud

If you still experience problems with dns requests or network problems afterwards, please feel free to contact our service desk, they will be happy to help you.

Helpcenter

General FAQ

Show all FAQs

OpenStack FAQ

Show all FAQs

Knowledgebase

Show all FAQs