Here are the commands to flush the DNS cache on an iMac (or any other Mac) starting at Leopard through to Yosemite.

To do this you will need to open a Terminal Prompt – Click on Launchpad and type in Terminal

Flush DNS iMac

OSX 10.10 – Yosemite Flush DNS

sudo discoveryutil udnsflushcaches

OSX 10.9  – Mavericks Flush DNS

dscacheutil -flushcache; sudo killall -HUP mDNSResponder

OSX 10.7 – 10.8  – Lion and Mountain Lion Flush DNS

sudo killall -HUP mDNSResponder

OSX 10.5 – 10.6 – Leopard and Snow Leopard Flush DNS

sudo dscacheutil -flushcache