Code Literacy

Unit 9 · Ship it and keep it alive

Why DNS changes take time: TTL explained

DNS resolvers around the world cache each answer for as long as its TTL (time to live) says, in seconds. Until that runs out, some visitors still get the old answer, so a correct change can take up to the TTL to reach everyone.

The mix-up

What people often think

“A DNS change takes effect the moment you save it.”

What the tutor says

Resolvers keep old answers until the TTL runs out. Check the nameserver directly to see the change, then wait.

What did the number before IN in the dig output mean?

How it works

Waiting only helps after a correct change. If a record is wrong, 48 hours later it is still wrong. Look at the records first, for example with dig, and fix the one that is wrong.

To see whether your change saved, ask your DNS provider’s nameserver directly; it answers with the new value at once, even while resolvers hold the old one.

An example

What worksExample
$ dig www.cornerbakery.ca
www.cornerbakery.ca.  3600  IN  CNAME  cname.host-dns.com.
#                      ^ TTL: cached for up to an hour
The number before IN is the TTL.

Close cousins of this mix-up

The tutor watches for these in the same lesson.

  • “DNS problems fix themselves if you wait 48 hours.”

    Waiting only helps after a correct change. First look at the records with dig and fix the wrong one.

  • “Saving a DNS record updates it everywhere at once.”

    Every resolver keeps its cached copy until the TTL expires. Here that is up to 24 hours.

Practise it with a tutor watching

Domains and DNS

Point a domain at a host, read DNS records, and fix a broken one without panicking about the wait.

25 minutes See it Build it Break it Say it
Start the lesson

Free with an account. The first two units need no account.

© 2026 webfaCeMEdia. Code Literacy™ is a trademark of webfaCeMEdia.