2 ms·
> if your IP address changes and your DNS needs to change along with it, a five-minute TTL is a very, very fine thing to have. This is discouraged by both RFC
by teddyh 6y ago
> if your IP address changes and your DNS needs to change along with it, a five-minute TTL is a very, very fine thing to have.
This is discouraged by both RFC 1912 and RIPE-203 (relevant for Europeans). Use a TTL of at least a few days (or more) if you know that you won’t be changing a DNS record anytime soon. It’s fine to have, say, an hour’s TTL for records you might want to change with little or no warning, and even five minutes is OK as a preparation for a specific scheduled change. But please don’t use a five minute TTL for all your DNS records as a matter of course!
- tombrossman 6y agoI have heard that setting a very long MX TTL can be helpful if your domain registration is ever hijacked. The idea is that enough resolvers will have the original cached records so you can still receive email (and prove ownership). Anyone have any experience with this?
- jlgaddis 6y agoI've not heard that specific reasoning before but I can believe it -- I've seen MTAs continue to (attempt to) send mail to the "old" MX for several days or even weeks (in a few cases) after the RR (with my "standard" 2d TTL) was updated.
- toast0 6y agoMicrosoft Exchange used to cache MX lookups for the life of the process. Which is pretty frustrating, but I think that may have coincided with the ~ 45 day uptime cap, so it wasn't completely awful.
- indolering 6y agoBoth of the cited standards are ancient and written from the perspective of network admins trying to reduce the bandwidth used by DNS back in the 90's (DNS messages usually fit within a single packet). An actual study came out in 2002 [0, 1] showing that DNS cache hit rates follow a power-law curve, with the bend starting at ~5 minutes and leveling off ~15 minutes. You will get very marginal gains with a TTL above 1 hour. IMHO, anything past an hour is a footgun for most people. I have to talk around an NDA here, but only big players like Google use a TTL past 24 hours. Google might care about shaving a few tens of milliseconds off of load times for a single user once a day, but you should worry more about customers not being able to load your website for a day because you screwed your DNS config. I really should submit a new RFC for TTL values. 0: https://ieeexplore.ieee.org/abstract/document/1041066 https://ieeexplore.ieee.org/abstract/document/1041066 1: http://cs.uccs.edu/~cchow/pub/master/ycai/doc/multipath/nissc/DNS%20performance%20and%20the%20effectiveness%20of%20caching.pdf http://cs.uccs.edu/~cchow/pub/master/ycai/doc/multipath/niss...