DNS or Domain Name Server is a protocol that helps translate the domain names to IP addresses to which it belongs. Without a DNS server, we have to remember the IP addresses for each website which is very hectic and impossible given that millions of IP addresses exist in the internet world today.
But what is the need to clear or flush the DNS cache? An extensive website getting millions and billions of visitor have multiple web server, and each server has a unique IP address assigned to it. These servers, known as Load Balancers, are used for balancing the server load and act as disaster management for fallback.
If a web server is down, it’s routed to a nearby server, hence changing its IP address stored in the cache, which results in network connection and site loading issues. Hence, when we clear the DNS cache, the new IP address is fetched and assigned to the domain address, which is again stored as a cache for quick response.
Each system has a different way of storing and flushing the DNS cache. Hence we have covered most devices operating systems that can help you fix the incorrect DNS issue.
Clear DNS Cache on Windows
The command prompt is one of the easiest ways to clear the DNS cache from Windows. You only need to execute two simple code words to flush the stored DNS cache. Here are the steps for your Windows PC:
- Click on the Start menu from the taskbar and search for Command Prompt in the search bar.
- Select the Run as administrator option.
It will launch the command prompt window with administrator permissions.
- Type the command ipconfig /flushdns and press key.
- You should see a message saying- Windows IP Configuration Successfully flushed the DNS Resolver Cache.
That’s it. The DNS cache of the Windows PC has been cleared. If you revisit a domain name, the fresh IP address will be fetched and assigned to the domain name.
Clear DNS Cache on Mac
Like the Windows PC, you can use the Terminal app on macOS to clear the cache stored in the network settings. Here are the steps to clear the DNS cache on macOS:
- Invoke Spotlight Search using + keys on your macOS.
- Search and open the Terminal app.
- Type the following command and press
sudo killall -HUP mDNSResponder && sudo dscacheutil -flushcache
key:
It might prompt you to enter your user password for executing the sudo user command. That’s it; DNS records are flushed and cleared from the macOS system.
Clear DNS Cache on Android
Flushing the DNS cache on Android smartphones is tricky. It doesn’t have a dedicated DNS cache-clearing option. However, it does have a DNS Settings page which helps in configuring the DNS addresses (like, Google DNS, CloudFlare DNS, etc.) if required.
The only way to clear the DNS cache is by using the Reset Network Settings option from the Internet settings page. Here are the steps to follow:
- Open the Settings app on your Android Phone.
- Select Network & Internet settings and open the Internet menu.
- Tap on the Reset Internet Settings command button from the top-right corner.
It will immediately reset the connected network settings and clear the DNS cache stored in the Android phone. You will have to reconnect with your Wi-Fi network after resetting.
To yield better results, you can also consider combining Airplane Mode and Reset Network Settings for a complete DNS cache wipeout.
Clear DNS Cache on iPhone
Like the Android phone, even the iPhone or iPad does not have the DNS cache clearing option. We have to rely on the network connection option to reset. One of the easiest ways is using the Airplane mode, which will disconnect and reconnect the network connection while performing the DNS flush.
Follow these steps to clear the DNS cache using the Airplane mode on your iPhone or iPad:
- Slide down to open the Control Center on your device.
- Tap on the Airplane mode button to Turn On.
- Wait for a few seconds and then Turn Off the Airplane mode.
It will disable and then enable the active network connection and clear the stored DNS cache.
Alternatively, there is an advanced but more complex way to clear the DNS cache using the Reset Network settings option under the Settings app > General > Transfer or Reset iPhone > Reset.
It will flush the DNS cache along with all your settings on your iPhone or iPad device.
Bottom Line
DNS is the backbone of networks and connections for the internet. It helps identify and resolve the domain name with a correct IP address to load the site in split seconds.
The cached DNS settings improve the speed but occasionally result in errors due to outdated records. Clearing or flushing the DNS cache can help update outdated records and resolve network-related issues.
While most systems do have an automated way to clear the DNS cache, it works in a fixed time interval like an hour, a week, etc., which the webmaster sets within the domain registrar console. Hence, manually clearing the DNS cache will help to fix the immediate site loading problems.
Lastly, if you've any thoughts or feedback on How to Clear and Flush DNS Cache on your Devices, then feel free to drop in below comment box. You can also report the outdated information.