Temporary failure resolving error on Ubuntu 20.04 Focal Fossa Linux

The following tutorial will provide you with simple to follow steps on how to resolve the Temporary failure resolving error on Ubuntu 20.04 Focal Fossa Linux

In this tutorial you will learn:

  • How to check current DNS server
  • How to how to internet connection
  • How to query DNS name

Temporary failure resolving error on Ubuntu

Temporary failure resolving error on Ubuntu

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Installed Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa
Software N/A
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

How to fix Temporary failure resolving error on Ubuntu 20.04 step by step instructions

If you get stuck at any of the below points try to resolve them before continuing, as each step might provide you with hints on how to fix your original Temporary failure resolving error.

  1. Although this error message is most likely related to the DNS server name resolution, the first step is to check our internet connection. To do so execute the following ping command:
    $ ping -c 2 8.8.8.8
    PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
    64 bytes from 8.8.8.8: icmp_seq=1 ttl=54 time=10.4 ms
    64 bytes from 8.8.8.8: icmp_seq=2 ttl=54 time=10.2 ms
    
    --- 8.8.8.8 ping statistics ---
    2 packets transmitted, 2 received, 0% packet loss, time 1006ms
    rtt min/avg/max/mdev = 10.157/10.291/10.425/0.134 ms
    

    The above command should result in 0% packet loss.



  2. Check your DNS server network configuration settings:
    $ systemd-resolve --status | grep Current
          Current Scopes: DNS
      Current DNS Server: 192.168.1.1
    

    Our system is set to use DNS server host with an IP address 192.168.1.1.

  3. Next, make sure that you can reach your DNS server. Again, the ping is a handy tool also here:
    $ ping -c 2 192.168.1.1
    PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
    64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.535 ms
    64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.570 ms
    
    --- 192.168.1.1 ping statistics ---
    2 packets transmitted, 2 received, 0% packet loss, time 1016ms
    rtt min/avg/max/mdev = 0.535/0.552/0.570/0.017 ms
    

    The output of the above command should result in 0% packet loss.

    In case you cannot reach your DNS it could mean that it either, does not respond to ping’s ICPM packages, it is behind the firewall or the server is down.

    In which case update your /etc/resolv.conf with an alternative DNS server.

  4. Test you DNS server by attempting to resolve DNS name eg. linuxconfig.org with dig command:
    $ dig @192.168.1.1 linuxconfig.org
    
    ; <<>> DiG 9.11.5-P4-5.1ubuntu4-Ubuntu <<>> @192.168.1.1 linuxconfig.org
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21662
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ;; QUESTION SECTION:
    ;linuxconfig.org.		IN	A
    
    ;; ANSWER SECTION:
    linuxconfig.org.	300	IN	A	104.26.3.13
    linuxconfig.org.	300	IN	A	104.26.2.13
    
    ;; Query time: 408 msec
    ;; SERVER: 192.168.1.1#53(192.168.1.1)
    ;; WHEN: Wed Dec 11 14:02:07 AEDT 2019
    ;; MSG SIZE  rcvd: 76
    


  5. Confirm system-wide settings by trying to resolve DNS host name. Example:

    $ resolvectl query linuxconfig.org
    linuxconfig.org: 104.26.3.13                   -- link: enp0s3
                     104.26.2.13                   -- link: enp0s3
    
    -- Information acquired via protocol DNS in 2.7ms.
    -- Data is authenticated: no