dscacheutil
dscacheutil – gather information, statistics and initiate queries to the Directory Service cache.
dscacheutil does various operations against the Directory Service cache including gathering statistics, initiating lookups, inspection, cache flush, etc. This tool replaces most of the functionality of the lookupd tool previously available in the OS.
How-to
How to flush the DNS cache
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
- This command is used to clear the local DNS cache. This might be necessary if a domain's IP address has changed recently and the system is still trying to reach the old IP address, or it here are DNS-related issues affecting the network connection.
dscacheutil -flushcacheclears the cache used by the Directory Service.killall -HUP mDNSResponderrestars the mDNSResponder service, which is responsible for DNS resolution. The-HUP(hang up) option sends a signal to the service to terminate and then restart, effectively refreshing it.