2009-03-24

DNS Update Speed: A TTL Primer Plus Tips

Just a real quick primer/tip on DNS updates. Keep in mind that this doesn't help if you haven't planned ahead, but if you know a day or two ahead of time that you are GOING to be changing DNS, you should go in and adjust the TTL values for the records you intend to change DOWN to a lower number.

For example, a TTL of 7200 means that the record in question can be cached on a client for up to two hours before the client MUST go back and request a "fresh" record. The problem is, changing the TTL is still subject to the *current* TTL, so if you change the TTL from 86,400 (1 day) to 300 (5 minutes), it will take a day before clients realize they can only cache records for 5 minutes. So this goes back to what I said originally, if you know you're are GOING to be changing DNS in a few days, lower the TTL ahead of time so the clients put themselves on short updates cycles. When you make your REAL DNS changes, they will happen almost instantly, and you can also bump the TTL back up to "normal" at the same time.

The reason you use a longer TTL is because it can pretty significantly affect the traffic load you place on your DNS server. A long TTL means fewer overall requests, because they get cached more. "Good" registrars like Network Solutions allow you to set your own TTL values. "Bad" registrars (**cough*GoDaddy!**coughcough***) don't.