PDF download Download Article PDF download Download Article

You can display the contents of your Domain Name System ("DNS") cache by using the Command Prompt app on PCs or the Terminal app on Macs. It can then be flushed through a series of commands, or by an Airplane Mode reset on mobile. DNS caches are responsible for cataloging the sites you visit, but a DNS error can prevent you from being able to view these sites. Displaying and flushing the cache will help fix these errors.

Method 1
Method 1 of 3:

Flushing the DNS Cache on a Phone or Tablet

PDF download Download Article
  1. You can't actually view the DNS cache on mobile, but you can flush the cache and thereby fix any DNS or "timing out" errors you have encountered.
    • Make sure your browsers in particular are closed.
  2. Scroll until you find the "Wi-Fi" menu.
    • For an Android, find the "Wireless and Networks" menu in "Settings".
    Advertisement
  3. Wait until your data indicator appears in the upper left-hand corner of the phone.
    • If you have an Android, tap the "Wi-Fi" switch to turn the wifi off.
  4. Wait until the wifi icon appears, then return to the "Settings" menu.
  5. Find "Airplane Mode" at the top of your Settings menu on iPhone. Be sure to wait a few moments (for the wifi indicator in the upper left-hand corner to disappear) before turning Airplane Mode back off again This will reset your network settings, thereby enabling the DNS cache to flush.
    • For Android, select "More" in the Settings menu to access the Airplane Mode setting toggle.
  6. This will turn off your phone and flush your DNS cache. Leave your phone off for at least 15 seconds.
    • For Android, you need to hold down the "Power" button, then tap "Power off" in the resulting menu.
  7. This will turn your phone back on.
  8. Use your phone's browser to visit any site where you encountered a DNS error. You should now be able to access the site!
    • Loading your frequently-used sites for the first time after a DNS flush will take longer than usual, since your DNS cache is being updated.
  9. Advertisement
Method 2
Method 2 of 3:

Viewing the DNS Cache on a PC

PDF download Download Article
    • For earlier operating systems, replace clicking "All Apps" with clicking "All Programs" and then selecting "Accessories".
  1. This should open "Command Prompt" with full access, allowing you to enter system commands.
  2. Double-check your typing, then hit Enter to view the cache. [1]
  3. You can use the results of your search to view the IP addresses of frequently-visited sites, or you can flush your DNS cache.
    • The DNS cache also stores your web browsing history - even if you clear it from your browser.
  4. Don't include the quotation marks. If you're encountering DNS errors in your browser, flushing your cache will fix this problem. Flushing can also help your computer run faster by keeping your website data up-to-date. [2]
  5. Open a browser and visit a site where you previously encountered a DNS error. You will now be able to access the site!
    • Loading sites after a DNS flush will often take longer than usual.
  6. Advertisement
Method 3
Method 3 of 3:

Viewing the DNS Cache on a Mac

PDF download Download Article
  1. Spotlight's icon is a magnifying glass located in the top right corner of your screen.
  2. Terminal lets you access system information--such as your DNS cache--through typed commands.
  3. Don't include the quotation marks. Press Return when you're done.
    • The "sudo" part of the command sets up the rest of the command for "root privilege", which allows you to view sensitive system information.
    • The "discoveryutil" part of the command request the DNS information from your system.
    • The "udnscachestats" part of the command displays one of two sections of your DNS cache.
  4. This should be the password you use to log in. Press Return when you finish typing. Terminal should display your Unicast DNS cache. [3]
    • The Unicast DNS (UDNS) cache translates website addresses (such as Facebook) into IP addresses for your computer to use during future searches.
    • With Unicast, your address sends out one IP address request to one server per site, regardless of how many servers exist. If that server becomes unresponsive, you will encounter a DNS error.
  5. You can use the results of your search to view the IP addresses of frequently-visited sites. If you encountered a DNS error, the UDNS cache is the most likely location of the problem.
    • You can also use the UDNS cache to check your recent site history. You will need to check the Multicast DNS cache as well for a complete report.
  6. This will help you avoid command errors when checking the next section of your DNS cache.
  7. Don't include the quotation marks. Press Return when you're done.
    • The "sudo" part of the command sets up the rest of the command for "root privilege", which allows you to view sensitive system information.
    • The "discoveryutil" part of the command request the DNS information from your system.
    • The "mdnscachestats" part of the command displays your Multicast DNS cache.
  8. This should be the password you use to log in. Press Return when you finish 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 to use during future searches.
    • With Multicast, your address sends out multiple IP address requests to multiple servers per site. If one server becomes unresponsive, you still have multiple connections to other servers, meaning you're much less likely to encounter a DNS error on a Multicast network than on a Unicast network.
  9. You can use the results of your search to view the IP addresses of frequently-visited sites.
    • You can also use the MDNS cache to check your recent site history. Checking the MDNS cache in conjunction with the UDNS cache will give you a full history report.
  10. Type "sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; say cache flushed" into Terminal. Hit Return to finalize the flush. This will reset your saved website data and clear any DNS errors you may encounter. This command is appropriate for the the latest version of OS X (10.11). [4]
    • This command flushes both cache sections (UDNS and MDNS). Flushing both sections resolves any current errors and prevents future errors from occurring, so you should always flush both for consistency. Flushing the cache will not harm your computer.
    • The Terminal commands to flush the DNS cache vary between OS X versions. Find out what version you are running by going to the Apple menu and selecting "About This Mac".
    • For OS X 10.10.4 and up type "sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; say cache flushed".
    • For OS X 10.10 to 10.10.3 users should type "sudo discoveryutil mdnsflushcache; sudo discoveryutil udnsflushcaches; say flushed".
    • For OS X 10.7 to 10.9 type "sudo killall -HUP mDNSResponder".
    • For OS X 10.5 to 10.6 type "sudo dscacheutil -flushcache"
    • For OS X 10.3 to 10.4 type "lookupd -flushcache".
  11. Use your browser of choice to visit a site on which you encountered a DNS error. You should now be able to access the site!
    • Loading your frequently-used sites for the first time after a DNS flush will take longer than usual, since your DNS cache is being updated.
  12. Advertisement

Community Q&A

Search
Add New Question
  • Question
    How can I read/view/display my DNS cache record before flushing it? All I can find is how to flush and how to look at statistics.
    Arc7urus
    Community Answer
    In Windows, from the command line: ipconfig /displaydns. There is no local DNS caching on a default Linux configuration. You will need to install and configure specific services (like nscd) to enable local DNS caching.
Ask a Question
      Advertisement

      Tips

      • Turning on and off Airplane Mode and then restarting any tablet or mobile phone should always flush the DNS cache.
      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Name
      Please provide your name and last initial
      Thanks for submitting a tip for review!
      Advertisement

      Warnings

      • You should always back up your computer and double-check all of your commands for accuracy before entering them into Command Prompt or Terminal.
      • Be wary of viewing or resetting the DNS cache on a work or shared computer. Always be sure to ask for permission first.
      Advertisement

      About This Article

      Thanks to all authors for creating a page that has been read 306,424 times.

      Is this article up to date?

      Advertisement