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.

link|improve this question
feedback

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

This question came from our site for system administrators and desktop support professionals.

3 Answers

up vote 7 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 so directly into your Network configuration.

link|improve this answer
feedback

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.

link|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  
+1 For a command that shows the servers for “multi-client” configurations (e.g. /etc/resolver/…). – Chris Johnsen Mar 16 '11 at 4:37
feedback

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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