Discover how to unveil the contents of your Domain Name System ('DNS') cache utilizing the Command Prompt app on PCs or the Terminal app on Macs. You can then clear it through a sequence of commands or by initiating an Airplane Mode reset on mobile. DNS caches keep track of the websites you visit, yet DNS errors may hinder your ability to access them. Displaying and clearing the cache can rectify these issues.
Procedures
Clearing the DNS Cache on a Smartphone or Tablet

Close all applications to prepare for clearing your DNS cache. While you can't directly view the DNS cache on mobile, you can clear it to resolve any encountered DNS or 'timing out' errors.
- Ensure all browsers are closed.

Navigate to the 'Settings' section. Scroll down until you locate the 'Wi-Fi' option.
- On an Android device, access the 'Wireless and Networks' section within 'Settings'.

Choose the 'Wi-Fi' tab, then toggle the switch to disable Wi-Fi. Wait until your data indicator appears in the top left corner of your phone.
- For Android users, tap the Wi-Fi switch to deactivate it.

Switch on your phone's Wi-Fi again. Wait for the Wi-Fi icon to appear, then return to the 'Settings' menu.

Toggle 'Airplane Mode' on and then off. Locate 'Airplane Mode' at the top of your iPhone's Settings menu. Wait briefly (until the Wi-Fi indicator disappears from the top left corner) before deactivating Airplane Mode again. This action will reset your network settings, allowing the DNS cache to clear.
- For Android, access 'More' in the Settings menu to toggle Airplane Mode.

Press and hold the 'lock screen' button, then swipe the 'Slide to Power Off' button to the right. This action will power off your phone and clear the DNS cache. Keep your phone off for at least 15 seconds.
- For Android, press and hold the 'Power' button, then select 'Power off' from the menu.

Press and hold the 'lock screen' button until your screen illuminates. This action will power your phone back on.

Verify that your DNS cache has been successfully flushed. Use your phone's browser to navigate to any site where you previously encountered a DNS error. You should now be able to access the site!
- When loading your frequently visited sites for the first time after flushing the DNS cache, expect longer loading times as the cache updates.
Examining the DNS Cache on a PC

Access the Start menu and select 'All Apps'.
- For older operating systems, replace selecting 'All Apps' with selecting 'All Programs' and then choosing 'Accessories'.

Click on 'Windows System'.

Right-click on the 'Command Prompt' application and choose 'Run as Administrator'. This action will open 'Command Prompt' with elevated privileges, enabling you to execute system commands.

Enter 'ipconfig /displaydns' (without quotes) into the command line. Ensure accuracy, then press ↵ Enter to view the cache.

Examine the DNS cache within the 'Command Prompt' interface. Utilize the obtained information to view IP addresses of frequently visited sites or to perform a DNS cache flush.
- The DNS cache retains your browsing history, even if cleared from your browser.

Flush the cache by entering 'ipconfig /flushdns' (without quotes). This process, beneficial for resolving DNS errors in your browser, also enhances your computer's speed by ensuring up-to-date website data.

Verify the success of your DNS cache flush. Open a browser and access a site previously affected by a DNS error. You should now be able to reach the site!
- Following a DNS flush, site loading may be slower than usual.
Exploring the DNS Cache on a Mac

Launch 'Spotlight'. You can find Spotlight's icon, a magnifying glass, in the top right corner of your screen.

Search for 'terminal' and open the Terminal application. Terminal allows you to access system information, including your DNS cache, through typed commands.

Type 'sudo discoveryutil udnscachestats' into Terminal. Exclude the quotation marks. Press ⏎ Return when finished.
- The 'sudo' portion of the command configures the rest of the command for 'root privilege', enabling access to sensitive system data.
- The 'discoveryutil' segment of the command requests DNS information from your system.
- The 'udnscachestats' segment of the command displays one of two sections of your DNS cache.

Input your Administrator password into Terminal. This should be your login password. Press ⏎ Return when done. Terminal should present your Unicast DNS cache.
- The Unicast DNS (UDNS) cache translates website addresses, like Facebook, into IP addresses for your computer's future searches.
- With Unicast, your system sends a single IP address request to one server per site, regardless of the number of servers available. If that server becomes unresponsive, you may encounter a DNS error.

Examine the Unicast DNS cache within Terminal. Utilize the obtained information to view IP addresses of frequently visited sites. If you've encountered a DNS error, the UDNS cache is likely the source of the problem.
- You can also utilize the UDNS cache to review your recent site history. For a comprehensive report, ensure to check the Multicast DNS cache as well.

Close and reopen Terminal. This action helps prevent command errors when inspecting the next section of your DNS cache.

Enter 'sudo discoveryutil mdnscachestats' into Terminal. Omit the quotation marks. Press ⏎ Return when finished.
- The 'sudo' portion of the command configures the rest of the command for 'root privilege', granting access to sensitive system data.
- The 'discoveryutil' segment of the command requests DNS information from your system.
- The 'mdnscachestats' segment of the command displays your Multicast DNS cache.

Input your Administrator password into Terminal. This should be your login password. Press ⏎ Return when finished typing. Terminal should display your Multicast DNS cache.
- The Multicast DNS (MDNS) cache also translates website addresses, such as Facebook, into IP addresses for your computer's future searches.
- With Multicast, your system sends multiple IP address requests to multiple servers per site. If one server becomes unresponsive, you still have multiple connections to other servers, reducing the likelihood of encountering a DNS error on a Multicast network compared to a Unicast network.

Review the Multicast DNS cache by scrolling. Utilize the obtained information to view IP addresses of frequently visited sites.
- You can also utilize the MDNS cache to review your recent site history. Reviewing the MDNS cache alongside the UDNS cache will provide a comprehensive history report.

Flush your DNS cache(s). Enter the command 'sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; say cache flushed' into Terminal. Press ⏎ Return to complete the flush. This action will reset your saved website data and resolve any encountered DNS errors. This command is suitable for the latest OS X version (10.11).
- This command flushes both cache sections (UDNS and MDNS), resolving existing errors and preventing future ones. For consistency, always flush both sections. Flushing the cache won't harm your computer.
- The Terminal commands to flush the DNS cache vary based on OS X versions. Determine your version by accessing the Apple menu and selecting 'About This Mac'.
- For OS X 10.10.4 and above, use 'sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; say cache flushed'.
- For OS X 10.10 to 10.10.3, employ 'sudo discoveryutil mdnsflushcache; sudo discoveryutil udnsflushcaches; say flushed'.
- For OS X 10.7 to 10.9, utilize 'sudo killall -HUP mDNSResponder'.
- For OS X 10.5 to 10.6, apply 'sudo dscacheutil -flushcache'.
- For OS X 10.3 to 10.4, execute 'lookupd -flushcache'.

Confirm that your DNS cache flush worked. Utilize your preferred browser to visit a site where you previously encountered a DNS error. You should now have access to the site!
- After a DNS flush, loading your frequently used sites for the first time may take longer than usual due to cache updates.
Recommendations
-
Toggle Airplane Mode on and off, then restart any tablet or mobile phone to flush the DNS cache consistently.
Caution
- Always ensure you back up your computer and meticulously verify all commands for accuracy before inputting them into Command Prompt or Terminal.
- Exercise caution when accessing or resetting the DNS cache on a work or shared computer. Always seek permission beforehand.