Display DNS Resolver Cache in Windows  

    Display DNS Resolver Cache in Windows

    Display DNS Resolver Cache in Windows

    How to Display Your DNS Resolver Cache in Windows
    Published by Category: Network & Sharing
    03 Apr 2018
    Designer Media Ltd


    How to Display Your DNS Resolver Cache in Windows


    A DNS (Domain Name System) resolver cache is a temporary database, maintained by Windows, that contains records of all your recent visits and attempted visits to websites and other Internet domains.

    The Internet relies on the Domain Name System (DNS) to maintain an index of all public websites and their corresponding IP addresses. Every time a user visits a website by its name (such as "tenforums.com"), the user's web browser initiates a request out to the Internet, but this request cannot be completed until the website name is converted into an IP address.

    This conversion process is called name resolution and is the job of DNS, but it takes time. A DNS cache attempts to speed up the process by handling the name resolution before the request is sent out to the Internet.

    If the IP address of a website changes before your DNS cache updates, you may not be able to load the webpage. If you are running into a lot of Page Not Found errors and you know you are connected to the Internet, you could try flushing your DNS cache to have your computer request new information.

    Viewing the contents of your DNS cache may help in troubleshooting to verify name resolution and IP.

    This tutorial will show you how to view the contents of your DNS resolver cache in Windows 7, Windows 8, and Windows 10.

    ipconfig /displaydns Output Explained:

    Output Description
    Record Name This is the name you query DNS for, and the records (addresses or something else) belong to that name.
    Record Type This is the type, displayed as a number - although more commonly they are referred to by their names, internally (in the DNS protocol) each has a number. Type 1 is "A" for "address", an IPv4 address. (IPv6 uses type 28, "AAAA", for an address four times as long.) "PTR", type 12, is a "pointer" to a hostname - most commonly used when mapping an IP address back to its name. "CNAME" is "canonical name".
    Time to Live This is the time in seconds after which the cache entry must expire.
    Data Length This is the length in bytes - an IPv4 address is four bytes, IPv6 is sixteen bytes. For CNAME or PTR, Windows displays a static number (either 4 or 8, depending on your system) - this is actually the size of a memory address where the actual text is kept.
    CNAME Record Domain (will check the address of this domain instead of the domain, CNAME records can have a very long TTL so its useful to avoid unnecessary queries.)
    A (Host) Record This is the IPv4 address of the domain name.
    AAAA Record This is the IPv6 address of the domain name.


     CONTENTS:

    • Option One: To Display DNS Resolver Cache in Command Prompt
    • Option Two: To Export DNS Resolver Cache to a .txt File





    OPTION ONE

    To Display DNS Resolver Cache in Command Prompt


    1. Open a command prompt.

    2. Enter the command below into the command prompt, and press Enter.

    ipconfig /displayDNS

    3. You will now see the contents of your DNS cache.

    Display DNS Resolver Cache in Windows-display_dns_cache_command.png

    If you see a Could not display the DNS Resolver Cache message, then either item below may be the cause.
    • You just flushed the DNS resolver cache. If so, then the next time you open a web page, the DND cache will have content again.
    • The DNS Client service has been disabled. If so, then enabling the "DNS Client" service and setting it to Automatic (Trigger Start) and Start (Running) will all the DNS cache to work again.

    Display DNS Resolver Cache in Windows-display_dns_cache_command-2.png






    OPTION TWO

    To Export DNS Resolver Cache to a .txt File


    1. Open a command prompt.

    2. Enter the command below into the command prompt, and press Enter. (see screenshot below)

    ipconfig /displayDNS >%USERPROFILE%\Desktop\DNS_cache.txt

    Display DNS Resolver Cache in Windows-output_dns_cache_to_file_command.png

    3. You will now have a DNS_cache.txt file on your desktop.

    4. You can open the DNS_cache.txt file to see the contents of your DNS cache.

    Display DNS Resolver Cache in Windows-dns_cache_txt_file.png

    If you see a Could not display the DNS Resolver Cache message, then either item below may be the cause.
    • You just flushed the DNS resolver cache. If so, then the next time you open a web page, the DND cache will have content again.
    • The DNS Client service has been disabled. If so, then enabling the "DNS Client" service and setting it to Automatic (Trigger Start) and Start (Running) will all the DNS cache to work again.

    Display DNS Resolver Cache in Windows-dns_cache_txt_file-2.png


    That's it,
    Shawn



  1. f14tomcat's Avatar
    Posts : 47,309
    Triple boot - Win 10 Pro, Win 10 Pro Insider (2) - (and a sprinkling of VMs)
       #1

    Good one, Shawn.

    404 errors are a good reason to take a look-see at the DNS. In addition, rogue sites and malware could inject a re-direct of say BANANAS.COM to ROTTENEGGS.COM. If a query to a site is obviously going somewhere else, one of the reasons may be this, along with things like infected hosts file and a hijacked site. If things look strange, the sister tutorial for flushing the DNS should be used. A little explanation about the TTL. The DNS is never automatically erased/flushed. Each entry remains for the duration of it's Time to Live (TTL).

    Default max is 1 day (86400 secs), unless specified in the DNS record. Bad responses are kept for a default of 5 minutes. That can explained what some experience...."It wasn't working yesterday, but today it's fine!".

    http://windowsitpro.com/networking/h...tive-responses

    windows 7 - How often does the DNS cache clear? - Super User
      My Computers

  2. Brink's Avatar
    Posts : 48,619
    64-bit Windows 10 Pro for Workstations build 19631
    Thread Starter
       #2

    Thank you Dick. I added some additional explanation of the output to the tutorial to help. :)
      My Computers


 

Tutorial Categories

Display DNS Resolver Cache in Windows Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


Related Threads
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 08:08.
Find Us




Windows 10 Forums