How to find the DNS server being used

8,788

Solution 1

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.

Solution 2

simply ssh to your pi and ask with nslookup...

ssh pi@pi # for exemple

then

~$ nslookup
> server
Default server: 208.67.222.222
Address: 208.67.222.222#53
> ^C
~$
Share:
8,788

Related videos on Youtube

LinuxFerLife
Author by

LinuxFerLife

Updated on September 18, 2022

Comments

  • LinuxFerLife
    LinuxFerLife over 1 year

    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?

  • LinuxFerLife
    LinuxFerLife about 6 years
    Thank you, but I get Default server: 127.0.0.1 and Address: 127.0.0.1#53
  • LinuxFerLife
    LinuxFerLife about 6 years
    I should mention, that I get that for both my laptop in Terminal and both SSH to the Pi and when using the keyboard and monitor directly to the Pi.
  • cmak.fr
    cmak.fr about 6 years
    find wich server program is listenning on port 53, then read his config. > netstat -antup | grep 53
  • Andrew Koster
    Andrew Koster almost 3 years
    This just gives an error on Ubuntu 20: sd_bus_open_system: No such file or directory.