To clear DNS caches completely on OS X Yosemite. you will need to clear both MDNS (Multicast DNS) and UDNS (Unicast DNS) caches via Terminal. Here’s how you can get this done.
Method 1: Clear MDNS & UDNS caches Separately
Enter the following commands separately in your terminal.
To launch Terminal, Command + Space to launch Spotlight, type "terminal", hit enter.
The first will clear the MDNS cache and the second will clear the UDNS cache. You will require the admin password to perfom this task.
sudo discoveryutil mdnsflushcache
sudo discoveryutil udnsflushcaches
Method 2: Clear MDNS & UDNS caches together
you can use the following command. Basically it’s the same, it combines both of the above into one.
sudo discoveryutil mdnsflushcache;sudo discoveryutil udnsflushcaches;say flushed