

To demonstrate just how versatile the Terminal is, I’ve rounded up 40 truly excellent Terminal tips and tricks that can come in very handy.Īll of the Terminal commands I’ll be showing you are perfectly safe to use and, when it comes to changing preferences, are completely reversible. There’s a great deal that Terminal can do, from moving large numbers of files to changing preferences that we didn’t even know exist. It’s a topic we’ve covered at length before with our popular series Taming the Terminal. This will report back something like the following, with the first “Server” and “Address” bit showing the DNS IP used by the local machine:įinally, another option is to look at /etc/nf, but because that file is automatically generated, it is not always considered accurate if DNS has recently changed and has not yet been flushed, do note that flushing DNS is a bit different in new versions of OS X, as Apple has changed how DNS functions on several occasions.The Terminal is an exceptionally powerful tool, providing a command line interface to the underpinnings of OS X.

If you need to, you can use a free utility like namebench to find a fast DNS server.Īdditionally, you can retrieve DNS information by using the ‘nslookup’ command on a server, this will report back the remote servers DNS details, as well as your own primary DNS to resolve the other server: Just replace the latter interface text with the interface you are looking to identify DNS IP information for, typically it’s the same for every interface on the computer.Īssuming 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:įor those wondering, the top most DNS IP in that sample list is Google’s Public DNS, the next two are from OpenDNS, with the last being a local router. Note that I’m specifying “Wi-Fi” or ‘airport’ in these example strings because I primarily use a wireless connection, but you could also specify ethernet and bluetooth to get the DNS details for those interfaces. Getting DNS info from the command line in prior versions of OS X, like Mac OS X 10.6 Snow Leopard, 10.5, and before, use the following syntax instead: Replace Wi-Fi with ethernet or your interface of choice if otherwise.

This presumes you’re using wi-fi, which most of us do these days.
