You are here

Finding out which DNS servers are currently being used in Linux (Ubuntu)

Submitted by Druss on Tue, 2020-12-08 21:23

So, I've been facing some DNS issues with my Ubuntu box and needed to do some debugging. While I was certain that my router was assigning the Google DNS servers ( and via DHCP to my machine, I needed to make sure that they were actually being used. Usually, I would be able to tell by looking at the output of /etc/resolv.conf oslt. However what I found in resolv.conf was

options edns0 trust-ad

Using tools like dig also resulted in the nameserver being listed as Googling around informed me that my Linux box was operating a DNS caching server locally. But how do I go about finding out which server this caching server was querying to resolve domains? Apparently, the answer is by using:

resolvectl status

which outputs a whole host of information including:

Link 2 (enp0s25)
      Current Scopes: DNS   
DefaultRoute setting: yes   
       LLMNR setting: yes   
MulticastDNS setting: no    
  DNSOverTLS setting: no    
      DNSSEC setting: no    
    DNSSEC supported: no    
  Current DNS Server:
         DNS Servers:
          DNS Domain: ~.    

IOW, the DNS servers my system was using were the Google servers.

Hope this helps :)


Disabling this local caching server can be done on Ubuntu by following the steps outlined here.