Time to Live or TTL is the term of validity of data in a given computer networks that limits the lifespan or lifetime of data, that determines how many intermediate stations (hops) a packet of data is allowed to pass in the Internet. We usually use Time to Live or TTL for Domain Name System (DNS) for Name Server Propagation. In brief, if TTL or Time to Live is very short like 300 Seconds, the propagation will take lesser time, but if it is set to higher value; DNS caching possibly (depends on setup) will take place, significantly reducing query time.
TTL or Time to Live : Basics
In computer networking, TTL or Time to Live prevents a data packet from circulating indefinitely. In computing applications, TTL or Time to Live is used to improve performance of caching or to improve privacy.
Internet Protocol (IP) specifies the TTL or Time to Live, which determines how many intermediate stations ( hops ) a packet in the Internet is allowed to pass. The data field for the TTL is an octet (8-bit field), so the maximum number of hops is 255. With each hop, the TTL is decremented by 1. When a data packet after its TTL has not yet reached its destination, it is discarded. The applied usage of this process is used with traceroute. In IPv6, it has been replaced by a simple equal-sized hop limit and the lifetime is up to the higher layer protocols. We have limited the terminology TTL to DNS records in this article for practical usage.
---
Checking TTL or Time to Live
Here are the practical usages of how TTL is checked :
1 | ~ nslookup -type=A -debug google.com |
It will give the output :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | Server:220.226.100.40 Address:220.226.100.40#53 ------------ QUESTIONS: google.com, type = A, class = IN ANSWERS: -> google.com internet address = 74.125.236.33 ttl = 159 -> google.com internet address = 74.125.236.34 ttl = 159 -> google.com internet address = 74.125.236.35 ttl = 159 -> google.com internet address = 74.125.236.36 ttl = 159 -> google.com internet address = 74.125.236.37 ttl = 159 -> google.com internet address = 74.125.236.38 ttl = 159 -> google.com internet address = 74.125.236.39 ttl = 159 -> google.com internet address = 74.125.236.40 ttl = 159 -> google.com internet address = 74.125.236.41 ttl = 159 -> google.com internet address = 74.125.236.46 ttl = 159 -> google.com internet address = 74.125.236.32 ttl = 159 AUTHORITY RECORDS: -> google.com nameserver = ns2.google.com. ttl = 257854 -> google.com nameserver = ns4.google.com. ttl = 257854 -> google.com nameserver = ns1.google.com. ttl = 257854 -> google.com nameserver = ns3.google.com. ttl = 257854 ADDITIONAL RECORDS: -> ns1.google.com internet address = 216.239.32.10 ttl = 126291 -> ns2.google.com internet address = 216.239.34.10 ttl = 125016 -> ns3.google.com internet address = 216.239.36.10 ttl = 124622 -> ns4.google.com internet address = 216.239.38.10 ttl = 129165 ------------ Non-authoritative answer: Name:google.com Address: 74.125.236.33 Name:google.com Address: 74.125.236.34 Name:google.com Address: 74.125.236.35 Name:google.com Address: 74.125.236.36 Name:google.com Address: 74.125.236.37 Name:google.com Address: 74.125.236.38 Name:google.com Address: 74.125.236.39 Name:google.com Address: 74.125.236.40 Name:google.com Address: 74.125.236.41 Name:google.com Address: 74.125.236.46 Name:google.com Address: 74.125.236.32 |
Simple usage :
1 | nslookup www.rackspace.com |
Output :
1 2 3 4 5 6 7 | Server:220.226.100.40 Address:220.226.100.40#53 Non-authoritative answer: www.rackspace.comcanonical name = www.wip.rackspace.com. Name:www.wip.rackspace.com Address: 173.203.44.116 |
For more information on nslookup tool, use :
1 | man nslookup |
on OS X, Other UNIX OS and GNU Linux. The command nslookup
works for Microsoft Windows too. You can easily get a text copy of the manual by running this kind of command :
1 | man nslookup > /path/to/nslookup.txt |