Ubuntu – How to find the DNS server being used

dnsnetworkingserver

Ubuntu 16.04, Acer i5, 6GB, 256GB-SSD.

Hi, I have pi-hole on a Pi and set my router DNS to point to it's IP address as described by the pi-hole install stuff.

The Internet access seems to be working OK, but, from my Ubuntu I'd like to see which DNS server is being used beyond the Pi. When I set pi-hole up, I selected DNSWatch as the default downstream (or upstream) but would like to see that it is being used.

Also, I'd like to see what DNS is being used when pi-hole is turned off. There is a delay of about 5-seconds and then my Acer/Router finds a DNS server to use.

I can add 2 more DNS servers in my dd-wrt router so was thinking of adding OpenDNS as a fall back if the pi-hole is down.

Is there a way to query the Pi, or my Ubuntu to get the outside DNS?

Best Answer

If you are running a more modern Linux and want an authoritative answer, run the command:

systemd-resolve --status

It will show all adapters and what each adapters DNS server is. So you can troubleshoot OpenVPN problems and others.

Related Question