Flushing / clearing DNS in Mac OSX

Below is how to clear / flush the DNS cache in Mac OSX.

(1) Open the terminal (Finder -> Applications -> Utilities -> Terminal)

(2a) In case your operating system is ‘Leopard’ (10.5.*) or ‘Snow Leopard’ (10.6.*), issue the following command:

dscacheutil -flushcache

(2b) Otherwise, for older operating systems, issue the following command:

lookupd -flushcache

This is the equivalent of the following Windows command: ipconfig /flushdns