4 ms·
In my experience TTL isn't respected at all. Clients will cache IP addresses no matter what.
by gizmo 10y ago
In my experience TTL isn't respected at all. Clients will cache IP addresses no matter what.
- mrb 10y agoI tested this pretty extensively. When I switched IPs, 99.9% of the HTTP traffic hit the new servers within the TTL time (5min). The only residual traffic hitting the old IPs I saw was from poorly configured bots & webspiders who probably don't re-resolve hostnames frequently enough. I remember also reading a post from Amazon EC2 Route 53 engineers who investigated DNS propagation times across large-scale tests in the world, and my observations aligned with theirs. They concluded the "DNS doesn't propagate according to TTL" story is mostly a myth (modulo rare issues here and there).
- toast0 10y agoWe use DNS for rotations at work. When we make a change, traffic starts moving right away, and most of the traffic moves within two or three TTLs. Most browsers do have some compensation mechanisms when some servers in the list don't respond, and will do even better if some servers are refusing connections. There are lingering connections for a long time though -- I think some DNS servers do cache until they are restarted. The load balancers we have available to us had worse uptime and scalability than our servers, so DNS it is. It would be nice to fully drain servers in a reasonable amount of time, but I can deal with it.
- szym 10y agoIndeed, for example Chrome wants to cache DNS results for at least a minute [1]. However, Chrome and Firefox cache the complete DNS/getaddrinfo response, i.e. all addresses. Therefore a server taken out of rotation will be quickly identified when a socket connection fails. [1] https://cs.chromium.org/chromium/src/net/dns/host_resolver_impl.cc?q=kMinimumTTLSeconds&sq=package:chromium&l=84&dr=CSs https://cs.chromium.org/chromium/src/net/dns/host_resolver_i...