Ubuntu – Get current DNS server on 16.04-server


Is there a simple command to find out which DNS server I'm using right now? Preferably without resorting to tcpdump or parsing log files?

I found a lot of stuff about nm-cli and other nm-tools but that doesn't apply to a server…

Best Answer

nslookup can be used to get the DNS server that is being used.


$ nslookup www.google.com
Server:     <--This is the DNS server address.

Non-authoritative answer:
Name:   www.google.com

Hope this helps!

Related Question