Web-tech nerd stuff

Flushing your DNS cache on Mac OSX 10.4, 10.5 and 10.6

If like me, you have to transfer websites between servers from time to time and you use an Apple Mac, you’ll probably need to know how to flush your DNS on Mac OSX (flushing is the term used for removing of all records to force an update).

For all versions of OSX, the simplest way to flush your DNS cache is to start “Terminal” which you can find in “Applications” > “Utilities” > “Terminal”. Once you’ve done that type (or copy + paste) into the Terminal:

OSX 10.5 (Leopard) & 10.6 (Snow Leopard):

dscacheutil -flushcache

OSX 10.4 (Tiger) and previous:

Type (or copy + paste) into the Terminal:

lookupd -flushcache

Then hit the Enter key.

You may also find that you need to restart your browser – you shouldn’t really need to but I find I sometimes do.

If you use Firefox, you might want to consider adding the extension “ShowIP” which is a very simple indicator that show the IP address(es) of the website you’re currently looking at in the Firefox status bar (at the bottom):

You can also use the Mac OSX Terminal (or a *nix terminal/console) to check DNS records using dig, for example to check the IP address(es) for you could type into the Terminal:

dig a

Which says “dig for a DNS ‘A’ record for ‘’”.

The output will look something like this:

Neil-Craigs-Mac-mini:~ neilcraig$ dig a

; <<>> DiG 9.6.0-APPLE-P2 <<>> a
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40181
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;        IN    A

;; ANSWER SECTION:    7200    IN    A

;; Query time: 178 msec
;; WHEN: Tue Jun  8 10:27:27 2010
;; MSG SIZE  rcvd: 55

You’ll see that the IP address is given as

Other types of DNS records you can dig for include MX e.g. “dig mx” which shows which Email server(s) will be used for the domain

You can read more about the use of dig here.

Created: Tue, 08 Jun 2010 09:00:00 GMT
Last modified: Wed, 28 Jun 2017 13:08:07 GMT