Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

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

share|improve this question

migrated from serverfault.com Mar 16 '11 at 3:39

This question came from our site for system and network administrators.

4 Answers 4

up vote 12 down vote accepted

Your router is acting as a DNS forwarder, you ask your router and your router asks a DNS server for you. You need to login to your router web config to figure out what it's using, or you could just enter it directly into your Network configuration.

share|improve this answer

You could try issuing a

scutil --dns | grep nameserver\[[0-9]*\]
at the command line. Should give you a list of DNS servers configured on your system.

share|improve this answer
that's a great command - it looks like that is the DNS server used by Comcast (my ISP). +1 for a great bonus point and what appears to be a deeper knowledge answer. –  mjb Mar 16 '11 at 4:14
+1 For a command that shows the servers for “multi-client” configurations (e.g. /etc/resolver/…). –  Chris Johnsen Mar 16 '11 at 4:37

That is the DNS server your mac is using. Your router is running a caching DNS server, and setting itself as the DNS server via DHCP. If you login to your router, you might be able to find out which DNS servers it uses.

share|improve this answer

Use the following command to view your DNS server in Mac OS X :

Open the terminal and type

$ cat /etc/resolv.conf

to view your DNS server.

Sample output :

$ cat /etc/resolv.conf 
domain http://www.example.com (Here, you can see DNS records info of the particular domain name.)
share|improve this answer
This will show the same thing that System Preferences > Network does. –  Kevin Panko Dec 16 '13 at 19:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.