Here are the command line / Terminal.app commands you can use to retrieve the active DNS server IP addresses on any Mac.
Launch the Terminal (Command-space for Spotlight, then type in Terminal). Type or paste in the following command:
Mac OS X 10.7 Lion:
networksetup -getdnsservers Wi-Fi
Mac OS X 10.6 Snow Leopard and before:
networksetup -getdnsservers airport
Note that until OS X Lion Apple referred to the Wi-fi as “Airport”. It was the Apple branded wi-fi. Since 10.7 they have changed tact and are now using the industry standard term “Wi-Fi”. In the above examples I have referred to the wireless connection because that’s what most of us use to connect to the Internet. However, if you wish to find the DNS assigned to the Ethernet (wired) connection, simply replace “airport” or “Wi-Fi” with “Ethernet”.
Assuming there are several DNS servers set within Mac OS X’s networking preferences, you will see a report of each DNS server in the order of their priority, looking something like this:
126.96.36.199 188.8.131.52 192.168.0.1
In the above example, the first two DNS IPs are for OpenDNS. The third one is the local ADSL modem/router.