Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: DNS TTL - Why Not Small?
11 points by pdx on Aug 13, 2010 | hide | past | favorite | 5 comments
When setting up my DNS parameters, I usually select my time to live as 86400 seconds. I occasionally regret this decision, when I need to make a change.

I see in another thread, that Posterous sets their DNS TTL at 5 minutes.

So, my question is, why wouldn't I just always use a 5 minute TTL. I assumed it was to be a "good internet citizen", I should leave it long. Is this a valid concern, or can I, with clear conscience, reduce it substantially?




The lower your ttl, the higher the traffic on your dns server. The more the load on the internet in general as other dns servers will have to query your server more often which might be slower because of the extra traffic.

There are reasons for low ttls... like your information changes quite often. I've managed tons of domains where the dns was basically setup and then never really changed. If it was going to change, we knew well in advance so we could do 48+ hours for a ttl.

If you need a low ttl do it, if you don't, be a "good citizen" and use a higher one.


Because with a low DNS TTL and you get a DDOS attack like what happened at DNSmadeeasy, your sites go down in 5 minutes. Also a high TTL puts lower load on the DNS servers and increases response times.

All that being said, I still use a low TTL so that I can quickly switch servers in the event one goes down.


One downside to short TTLs on hosts that receive mail is that if you have some sort of DNS issue for more than 5 minutes, mail may start getting rejected, because many mail servers treat hostname-not-found or no-MX-records-for-domain as a permanent rather than transient error, so bounce the mail and don't retry. With a higher TTL, there will be a greater period where the server has the wrong IP after a change, but that will typically result in a transient error, of the "isn't responding" rather than "doesn't exist" variety.


Because a low TTL means that a reasonable % of page requests are going to see not only the latency of your DNS server, but also that of the shitty ISP's fetch store return cycle, which can result in a couple hundred extra ms on top of your page serving time. This extra bit of latency can make for a bad user experience, so they may not come back (every little bit counts).

Because ISPs are likely to ignore it anyways and impose whatever _they_ think is a good value.


Shorter TTL's just increase traffic between caching nameservers and authoritative nameservers (http://en.wikipedia.org/wiki/Time_to_live#DNS_records). Because of this, some DNS providers set a limit on how low your TTL can go. Others charge for DNS queries over a certain amount.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: