How do I check what DNS server I’m using (on Mac OS X)

In Mac OS X, how do I check what DNS server I’m currently using (preferably a command line solution)?

System Preferences > Network shows 192.168.1.1, which is my router’s address and not the real DNS server.

Source: How do I check what DNS server I’m using (on Mac OS X)

Advertisements