To flush DNS (Domain Name System) cache on a Mac, you can use the Terminal application. Here’s how you can do it:
- Open Terminal:
- You can find Terminal in the “Utilities” folder within the “Applications” folder, or you can use Spotlight (Command + Space, then type “Terminal”).
- Enter the Command:
- In the Terminal window, type the following command and press Enter:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
- You may be prompted to enter your administrator password. Type it and press Enter.
- In the Terminal window, type the following command and press Enter:
- Verification (Optional):
- You can verify that the DNS cache has been cleared by running a command like:
dscacheutil -q host -a name example.com
Replace “example.com” with the domain for which you want to check the DNS resolution. If the cache has been cleared, you should see a message indicating that the domain was not found.
- You can verify that the DNS cache has been cleared by running a command like:
To flush the DNS cache on a Windows computer, you can use the Command Prompt. Here are the steps:
- Open Command Prompt as Administrator:
- Press the
Windows key + X
to open the Power User menu. - Select “Command Prompt (Admin)” or “Windows PowerShell (Admin).” If you’re using Windows 10 or later, you might see “Command Prompt” or “Windows PowerShell” without “(Admin)” – in that case, right-click and choose “Run as administrator.”
- Press the
- Flush DNS Cache:
- In the Command Prompt window, type the following command and press Enter: code
ipconfig /flushdns
- In the Command Prompt window, type the following command and press Enter: code
- Verify the Flush (Optional):
- You can check if the DNS cache has been successfully flushed by typing the following command:
ipconfig /displaydns
This command displays the contents of the DNS resolver cache. If it has been flushed, you should see a message indicating that the DNS Resolver Cache has been cleared.
- You can check if the DNS cache has been successfully flushed by typing the following command:
- Close the Command Prompt:
- After flushing the DNS cache, you can close the Command Prompt window.