HT202516: Reset the DNS cache in OS X

Learn about Reset the DNS cache in OS X
apfritts

Q: Is discoveryutil mdnsflushcache synchronous or asynchronous?

I am trying to flush my cache with:

 

sudo discoveryutil mdnsflushcache

sudo discoveryutil udnsflushcache

 

And then immediately run a curl requesting a file from the web. I've had to add a sleep statement after the cache flushes in order for curl to pickup (request) the correct DNS information.

 

Is that correct? Or is something else going on here?

MacBook Pro with Retina display, OS X Yosemite (10.10.2)

Posted on Feb 25, 2015 4:55 PM