Caching, TTL, and DNS Issues
See how caching speeds lookups and how stale records cause trouble.
Caching, TTL, and DNS Issues is a free Network+ Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Network+ Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Why Caching Exists
Querying the full DNS hierarchy for every lookup would be slow and would overload the servers. Caching stores recent answers so repeated lookups are instant.
Resolvers, operating systems, and even browsers keep DNS caches. Caching is what makes DNS fast and scalable across billions of daily queries.
What TTL Controls
Each DNS record carries a TTL (Time To Live), a number of seconds telling caches how long to keep the answer before it expires.
A record with a TTL of 3600 can be cached for one hour. After the TTL elapses, the cache discards the entry and must look it up fresh next time.
example.com A 93.184.216.34 TTL 3600Short vs Long TTL
TTL is a trade-off. A long TTL means fewer lookups and faster responses, but changes take longer to spread. A short TTL propagates changes quickly but increases query load.
Admins often lower the TTL before a planned migration so the new address spreads fast, then raise it again afterward.
How Records Propagate
When you update a DNS record, the change does not appear everywhere at once. Caches around the world still hold the old value until their TTL expires.
This delay is called propagation. A change may take minutes to hours to be seen globally, depending on the previous TTL — a common source of confusion after edits.
Stale Cache Problems
A frequent DNS issue is a stale cache: a device keeps using an old, cached IP after the real address changed. The site appears broken even though the record is correct.
The fix is to wait for the TTL or flush the cache. On many systems you can clear it manually to force a fresh lookup immediately.
Flushing the DNS Cache
When stale entries cause trouble, flushing the cache forces the device to discard cached records and query again. This is a standard early troubleshooting step.
Different systems have their own flush command. After flushing, the next lookup hits the resolver fresh, picking up any recent record changes.
ipconfig /flushdns (Windows example)Wrong Resolver Settings
If a device points to an unreachable or misconfigured resolver, name resolution fails entirely even when the network works. Checking the configured DNS server is a key diagnostic.
Switching to a known-good public resolver, such as 8.8.8.8 or 1.1.1.1, quickly tests whether the original resolver was the problem.
The Hosts File Override
Before consulting DNS, most systems check a local hosts file that maps names to addresses manually. An entry there overrides DNS for that name.
A forgotten or malicious hosts entry can silently redirect a name to the wrong IP, so checking the hosts file is a smart step when one specific name misbehaves while others resolve fine.
Recognizing DNS Failures
Classic DNS failure signs include: a site loads by IP but not by name, a "server not found" error, or slow initial connections.
If pinging an IP succeeds but pinging the name fails with an unknown-host error, DNS is the culprit. This quick test isolates DNS from other connectivity issues.
Tools to Diagnose DNS
Use nslookup or dig to query DNS directly. You can ask a specific server, check which record is returned, and see the TTL remaining.
These tools let you compare what your resolver returns against the authoritative answer, revealing stale caches or misconfigured records at the source.
Closing the DNS Course
Most DNS problems trace back to caching and TTL behavior, a bad resolver, or an incorrect record. A structured check — test by IP, verify the resolver, flush the cache, query with nslookup — isolates the cause. Understanding TTL and propagation explains why changes seem delayed.
This rounds out the addressing and naming foundation essential for the Network+ exam.
Quick Check
Interpret a TTL scenario.
Recap
You learned about caching, TTL, and DNS issues.
- Caching stores recent answers to make DNS fast.
- TTL sets how long a record may be cached before refreshing.
- Long TTL = fewer lookups but slow changes; short TTL = fast changes, more load.
- Propagation delay and stale caches cause many DNS problems; flushing helps.
- Diagnose with by-IP tests, resolver checks, and nslookup.
Frequently asked questions
Is the “Caching, TTL, and DNS Issues” lesson free?
Yes — the full text of “Caching, TTL, and DNS Issues” is free to read here on the web, and the Network+ Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Network+ Academy course, upgrade to CoddyKit PRO.
What will I learn in “Caching, TTL, and DNS Issues”?
See how caching speeds lookups and how stale records cause trouble. You practise Network+ Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Network+ Academy?
No prior experience is required. Network+ Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Caching, TTL, and DNS Issues” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Network+ Academy lesson?
Yes. Every Network+ Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Why DNS Exists
- Walking Through a DNS Lookup
- Common DNS Record Types
- Caching, TTL, and DNS Issues