DEV Community

Discussion on: Explain DNS TTL Like I'm five

Collapse
 
peter profile image
Peter Kim Frank

Is it a best practice to only have my grandma call every two minutes if I'm aware there might be some family emergency she should know about? "Uncle Tim is going in for surgery — ping me every two minutes to see how he's doing" type of thing?

Is there a risk that by having her call every two minutes, every day, forever, that she could jam up my phone line for other important calls? Or is it just not a good practice if it's not necessary to be a good-citizen of the other users of this telecom?

Thanks for the explanation! Super interesting stuff.

Collapse
 
preciselyalyss profile image
Alyss 💜 • Edited

It is really dependent on your needs. I have historically done 24 hours, but needed to temporarily change it to 20 minutes because I'm deploying a new microsite, trying to update some other minor feature that relies on DNS records, etc. As a result, I had to wait 24 hours after I set it to 20 minutes in order for the update to take place.

Best practice for making a change: if your TTL is X, then X units of time before you need to make a change, update it to 5 minutes.

A higher TTL reduces the perceived latency of a site and decreases the dependency on the authoritative name servers. It isn't necessarily jamming the phone line, which is where the analogy fails. It takes more hops to get the correct nameserver information back thus the increase in perceived latency. A longer TTL/less perceived latency means the information has been cached on a nameserver (non-authoritative) that is a shorter hop between the end-user and DNS information that isn't yet stale.