How to display the current DNS servers from the command line under OS X

command linedns

I want to display the DNS servers that are used by the current network setup on OS X, from the command line.

Best Answer

There are several ways - here are two:

cat /etc/resolv.conf

-or-

scutil --dns