Sometimes DNS records get cached on your local computer which causes issues when trying to view your website. This can be especially problematic when your site changes an IP or is moved.
Normally, systems are configured to check for a new IP Address after a short time, but in some cases, those record timeouts can be extended to hours, sometimes even days.
If you are sure that your DNS records have been updated, and they have reflected the change on sites like https://www.whatsmydns.net/ chances are you are dealing with a local DNS cache issue. The issue is relatively easy to fix with a few short commands.
Clearing DNS Cache on Mac:
- Open the Terminal application. You can find it in the "Utilities" folder within the "Applications" folder, or you can use Spotlight Search (Command + Space) to search for "Terminal."
- In the Terminal window, type the following command and press Enter:
-
sudo dscacheutil -flushcache
- After entering the password, press Enter. The DNS cache will be cleared, and you will not receive any confirmation message in the Terminal.
Clearing DNS Cache on Windows:
- Open the Command Prompt. You can do this by pressing the Windows key, typing "Command Prompt," and selecting the "Command Prompt" app. Note: If you're using Windows 10, you can also press Windows key + X and choose "Command Prompt (Admin)" or "Windows PowerShell (Admin)".
- In the Command Prompt window, type the following command and press Enter:
bash
-
ipconfig /flushdns
- You should see a message saying, "Windows IP configuration successfully flushed the DNS Resolver Cache."