Obtain the DNS while on DHCP on Mac OS X

Just the other day I needed to look up the DNS on my Mac. Now if you look at network preferences and if you are connected to the net via DHCP, Mac OS X provides you with a quite unhelpful looking window.

network preferences
Network Preferences

Of course there is a CLI to obtain this information. All you need to do is hit

ipconfig getpacket en1

(en1 is the network interface you are interested in). Voila, you have what you need.
I was pretty surprised that ipconfig works on *nix too. I always thought that ifconfig was for *nix and ipconfig was for Windows.

Technorati tags:  ,  ,  ,  

Leave a Reply

Your email address will not be published. Required fields are marked *