3 ms·
Could someone add some context please? I see that apparently the method to flush the DNS cache changes between versions. Is there a deeper reason why this is ne
by germanier 10y ago
Could someone add some context please? I see that apparently the method to flush the DNS cache changes between versions. Is there a deeper reason why this is necessary?
- trebor 10y agoI'm not sure. The `dscacheutil -flushcache` command he lists for Snow Leopard still works for me (OS X Yosemite here).
- NEDM64 10y agoAnd it still works for me on macOS 10.12. So I see absolutely no point here.
- masklinn 10y agoThe command doesn't fail but does it actually flush the DNS cache, or does it flush the Directory Cache which isn't used for DNS anymore (or possibly at all, on my El Cap machine flushing succeeds but any query of the cache content or its statistics replies "Unable to get details from the cache node")
- sirn 10y agoThe command did flush the Directory Service cache, but DNS is no longer part of it. You can still use its query command though. dscacheutil -q host -a name www.example.com On the topic, easiest way to see if dscacheutil -flushcache work or not is to probably do something like: dscacheutil -q host -a name www.example.com # Make sure it's in the cache prior to running. sudo dscacheutil -flushcache dscacheutil -q host -a name www.example.com # Notice if there's a slight delay for the lookup. sudo killall -HUP mDNSResponder dscacheutil -q host -a name www.example.com # Notice if there's a slight delay for the lookup.
- simook 10y ago"macOS" has a tendency to cache stale DNS. But over the years they have changed the commands to flush the cache, so you end up googling how to clear the cache, checking your version of osx, and pray to the DNS gods that it will work this time.
- sirn 10y agoBasically: * Snow Leopard and earlier use lookupd for DNS resolving (`dscacheutil -flushcache`) * Since Lion, they switched from lookupd to mDNSResponder, presumably for Bonjour protocol support (`killall -HUP mDNSResponder`) * Yosemite switched to discoveryd that basically is a rewrite of mDNSResponder (`discoveryutil mdnsflushcache`) * Due to a lot of problems with discoveryd, they switched from discoveryd back to mDNSResponder since v10.10.4 (so we're back to `killall HUP mDNSResponder`) https://support.apple.com/en-us/HT202516 https://support.apple.com/en-us/HT202516