It seems that the day is tightening and with 28 degrees in the shade in Las Palmas de Gran Canaria we are going to explain to you how to empty the DNS cache in case you have problems when resolving a certain IP against a domain. It is a small tutorial focused on advanced users since you have to use the OS X Terminal.
The first thing you have to know is that the way we had to do this action has changed with the advent of OS X Yosemite and that, as far as we know, will continue in this vein on OS X El Capitan which will be released in fall. In operating systems prior to OS X Yosemite, the process was done through mDNSResponder, but now it has been replaced by discoveryutil.
In OS X Yosemite, to proceed with flushing the DNS cache you have to use a combination of several commands in the OS X Terminal. Those commands will flush the MDNS cache (it is the Multicast) and the UDNS cache (the Unicast). Let's start with the process you have to do to clear the DNS cache:
We open the Terminal, for which we look for it in the Spotlight or go to Launchpad> OTHERS folder> Terminal. Once the Terminal is open, you will proceed to write the following commands:
sudo discoveryutil mdnsflushcache
y
sudo discoveryutil udnsflushcaches
As you can see, they are two separate commands and each time we enter one we will be asked for the administrator password since they begin with sudo. Now, if you want to do the process with a single line of code, you should write it like this:
sudo discoveryutil mdnsflushcache;sudo discoveryutil udnsflushcaches;say flushed
For terminal the article we indicate that if before emptying the DNS cache you want to see the information that there is so much In Multicast as in Unicast you must use the following commands:
sudo discoveryutil mdnscachestats
or this one for Unicast:
sudo discoveryutil udnscachestats
If you want to do this on other OS X systems:
OS X Mavericks (10.9)
|
dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
OS X Mountain Lion (10.8)
|
sudo killall -HUP mDNSResponder |
OSX Lion (10.7)
|
sudo killall -HUP mDNSResponder |
OS X Snow Leopard (10.6)
|
sudo dscacheutil -flushcache |
OS X Leopard (10.5)
|
sudo dscacheutil -flushcache |
OSX Tiger (10.4)
|
lookupd -flushcache |
at 10.10.4 mdnsrespond returns
The same as Rafa in l1 10.10.4 he does not recognize the commands.