How to Clear the Local DNS Cache on macOS

March 4, 2023 / Domain and DNS

This article gives an explanation on how to clear the local DNS cache on macOS. The DNS cache may become corrupted or out-of-date over time, which might cause connectivity issues. Malware can potentially influence it, sending you to malicious websites or phishing sites through your browser. The DNS cache on your Mac can be flushed to solve these issues.

Check out our KB to learn more about flushing the local DNS cache on Linux servers- https://www.webhosting.uk.com/kb/how-to-flush-the-local-dns-cache-in-linux-server/

To clear the local DNS cache on a Mac running macOS, you can follow these steps:

  1. Open the Terminal application.
  2. You can do this by using Spotlight search or navigating to Applications > Utilities > Terminal.
  3. Type the following command into the terminal and press enter:
    sudo killall -HUP mDNSResponder
  4. You will be prompted to enter your administrator password. Type it in and press enter.
  5. The command above will reset the DNS cache. You can verify that the cache has been cleared by running the following command:
    dscacheutil -q host -name test.com
  6. Replace test.com with the domain name you want to check. If the cache has been cleared, the response should be something like:
    Name: test.com
    No such key: `name’ in cache

That is it! Your local DNS cache on your Mac should now be cleared.

Please make sure to look over and utilise our most recent hosting options at www.webhosting.uk.com.

If you have any questions or concerns, our support staff and committed sales managers are always available to help you by phone or through our live chat service, which is available around-the-clock.

Dominos Search