liveBook · Manning

DNS cache

As explained in Acing the CCNA Exam: Volume 2 Advanced Networking and Security

DNS caching is the temporary storage of DNS answers so subsequent name-resolution requests can be answered without repeating all queries.

A DNS cache temporarily stores name-to-IP-address mappings. When a device needs to resolve a URL, it checks the cache first; a matching entry completes resolution without contacting a DNS server. Operating systems and applications such as web browsers may maintain separate caches. section 3.1.2

Name resolution uses the cache in this sequence:

  • The device checks for a matching cached name-to-IP mapping. section 3.1.2
  • On a cache hit, the device uses the stored address and sends no new DNS query. section 3.1.2
  • On a cache miss, the device sends a query to its configured DNS server, then stores the successful mapping. section 3.1.2
  • Caching can occur throughout recursive and iterative resolution, reducing the number of DNS queries required. section 3.1.4

Inspecting a Windows DNS cache

Run `ipconfig /displaydns` to display cached records. An entry for `www.google.com` shows the record name, record type, time to live, and cached A-record address `142.250.196.100`. section 3.1.2

A Cisco router configured with `ip dns server` can cache answers for clients in its LAN. If R1 forwards a query to an external server such as 8.8.8.8, it can answer later clients from its cached mapping; `show hosts` displays dynamically learned temporary entries alongside permanent manual mappings. section 3.2.2

C:\Users\jmcdo> ipconfig /displaydns
. . .
    www.google.com
    ----------------------------------------
    Record Name . . . . . : www.google.com
    Record Type . . . . . : 1
    Time To Live  . . . . : 267
    Data Length . . . . . : 4
    Section . . . . . . . : Answer
    A (Host) Record . . . : 142.250.196.100
. . .

Use the annotated DNS-cache listing to identify a cached hostname, record type, lifetime value, and address. section 3.1.2

How Acing the CCNA Exam: Volume 2 Advanced Networking and Security covers it

How deep it goes
Explains cache hits, misses, storage, multiple cache levels, and recursive-resolution caching, with command output but no cache-management internals.
Examples
Uses browser lookups, www.google.com, mail.google.com, Windows ipconfig /displaydns, and Cisco IOS show hosts output.
What it assumes
Assumes basic DNS name resolution and introduces DNS-server discovery through DHCP or manual configuration.
What you can do after
Diagnose with ipconfig /displaydns or show hosts whether a hostname-to-address mapping is cached.
How it connects
Connects DNS caching with name resolution, recursive queries, iterative queries, DNS servers, and DHCP or manual DNS-server configuration.

Also explained in

Compare how 2 books explain DNS cache →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the CCNA Exam: Volume 2 Advanced Networking and Security. The section links point to the parts of the book it draws on.