Saturday, February 09, 2008

Flushing DNS

When accessing websites or mailservers, your DNS resolver caches the request so that future lookups are fast. However, sometimes when a zone on DNS is being changed while you work, you want to be able to clear the cache to force the resolver to get the latest name:IP address pair mappings. Here are some command line commands for flushing the DNS cache on your local machine: On Mac OS X Tiger:
lookupd -flushcache
On Mac OS X Leopard:
dscacheutil -flushcache
On Windows:
ipconfig /flushdns
Update: I noticed that this cache seems to survive reboots, on Leopard.

Thursday, February 07, 2008

Tip - Get the OS X Version from CLI

If you are logged into OS X as usual, you can get your system version from "About This Mac" in the Apple menu. This is not helpful when you are remotely connected to a server via SSH, however. So how do you do it? You can get OS X's version from the command line, like this:

jrclt2007:~ rcogley$ sw_vers
ProductName:    Mac OS X
ProductVersion:      10.5.1
BuildVersion:  9B18