13

What happens when someone gets access to your DNS control and sets a TTL of 100 years on your domain, while pointing it's IP to some obscure website?

(and you discover it too late of course)

  • 10
    The guy in charge gets fired. – Xavier Lucas Sep 20 '14 at 17:32
  • 5
    Just a short note: The maximal TTL value is 2^31-1, which is just a bit more than 68 years :) See RFC 2181. – Sven Sep 20 '14 at 17:37
21

Ryan has provided an excellent answer to one interpretation of your question. Given our target audience however, and the situation of the people most likely to stumble upon the question, I'm going to answer a different one.

What does a company do when a bad TTL makes it out into the wild?

You have a few options here. First and foremost though, you need to identify the problem vector and eliminate it. Trying to contain the damage is pointless when you have no control over the problem repeating itself.

  1. Wait. If it's not a crucial record, you can probably wait it out. As Ryan has covered, the "maximum damage" is not 68 years, but in practice most likely to be 7 days. This is the most common default for the maximum life of a positive cache entry (BIND, JunOS, etc.). Even in cases where this is not accurate, one would hope the server is receiving routine security updates that force a process restart. Speaking as the operator of several large clusters I do not find it likely that a MSO would set this to a larger value on purpose: it only serves to generate more external inquiries (which we hate). You may have to move on to the next steps for companies using less popular software, or operators who hate themselves.
  2. Annoy DNS cache operators. If you need to get record cleared from cache ASAP, your only real choice is to start reaching out to the largest providers of recursive DNS you can think of and work your way down. Some of these companies are likely to ignore you: either they think your company is too small for their customers to care about, or they institute cache purging policies of their own to minimize the number of support calls they have to deal with. In the latter case, they will probably shrug and let the problem take care of itself at the scheduled time. Your company did create this problem for itself, after all.
  3. Get ISP customers to annoy their ISP for you. If it's been a few days and a large ISP is ignoring the cached record, try to get one of their customers to complain and generate a ticket internal to that company. This is harder for them to ignore, but it will not win you any favors with their ops team as from their perspective you did this to yourself. If this is a repeat occurrence, they will probably start canceling these tickets just to spite you.
  4. Advise your partners to bypass the DNS record. If it's a mission critical DNS record consumed by your partners and none of the above options are acceptable (i.e. you are bleeding revenue by the minute), your company has no choice but to work with its partners to bypass the problem. If they do not control their local cache, this is usually this is accomplished by inserting entries into the hosts table of the effected systems as it avoids the need to modify the programs that are using the DNS record. This is only viable if the revenue loss is tied to a select few companies consuming the data. In all other cases you're stuck with the first three options.
  • 3
    As an example for option 2, Google Public DNS has this page to clear it's cache. – Bardi Harborow Feb 12 '15 at 5:16
16

Well, first of all the Bind configuration manual I'm looking at states that TTL is a signed 32-bit integer, expressed in seconds, giving it a theoretical maximum of 2^31. It says

Valid TTLs are of the range 0-2147483647 seconds.

Or approximately 68 years. So you probably cannot set it to 100 years in the first place.

So, let's say you set it to 68 years. It's pretty clear what would happen. DNS resolvers that respected the extremely long TTL on your DNS records would cache them for as long as they could. Some DNS resolvers don't respect TTLs at all and just implement their own caching policy however they wish.

The reason we can't put a single hard number on the maximums is because there are many different implementations of DNS created by many different vendors, and they all use slightly different variables. For instance, A DNS server running on Juniper JunOS will only go up to 604800 seconds, or 7 days, on the TTL.

  • So that actually means when someone hacks the DNS control of company X puts it on 68 years and forwards the IP to pornhub, he has actually destroyed the domain name 'forever'?? :X – Dirk Boer Sep 20 '14 at 18:24
  • 11
    Assuming that you've corrected the problem, it's unlikely that downstream DNS servers will go 68 years without their caches being cleared, by rebooting, for instance. It's also likely that downstream DNS resolvers implement their own idea of "MAXTTL" that puts a more reasonable cap on received TTLs such as 3 days instead of 68 years. Read RFC 2308 as an example of what I'm talking about. – Ryan Ries Sep 20 '14 at 19:08
  • 4
    Regarding BIND specifically it has a default limit of 7 days. max-cache-ttl: "Sets the maximum time for which the server will cache ordinary (positive) answers. The default is one week (7 days)." – Håkan Lindqvist Sep 21 '14 at 17:12

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.